Skip to content

[MLIR][ExecutionEngine] Introduce shared library #87067

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions mlir/lib/ExecutionEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,29 @@ add_mlir_library(MLIRExecutionEngine
MLIRTargetLLVMIRExport
)

if(LLVM_BUILD_LLVM_DYLIB)
# Build a shared library for the execution engine. Some downstream projects
# use this library to build their own CPU runners while preserving dynamic
# linkage.
add_mlir_library(MLIRExecutionEngineShared
ExecutionEngine.cpp
SHARED

EXCLUDE_FROM_LIBMLIR

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/ExecutionEngine

# Ensures that all necessary dependencies are resolved.
DEPENDS
MLIRExecutionEngine

LINK_LIBS PUBLIC
LLVM
MLIR
)
endif()

get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
add_mlir_library(MLIRJitRunner
JitRunner.cpp
Expand Down