Skip to content
This repository was archived by the owner on Oct 11, 2025. It is now read-only.

Commit d8ad9a1

Browse files
authored
Reapply "[mlir] Link libraries that aren't included in libMLIR to libMLIR" (#123910)
Use `mlir_target_link_libraries()` to link dependencies of libraries that are not included in libMLIR, to ensure that they link to the dylib when they are used in Flang. Otherwise, they implicitly pull in all their static dependencies, effectively causing Flang binaries to simultaneously link to the dylib and to static libraries, which is never a good idea. I have only covered the libraries that are used by Flang. If you wish, I can extend this approach to all non-libMLIR libraries in MLIR, making MLIR itself also link to the dylib consistently. [v3 with more `-DBUILD_SHARED_LIBS=ON` fixes]
1 parent 7b056fc commit d8ad9a1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mlir/lib/CAPI/ExecutionEngine/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
set(LLVM_LINK_COMPONENTS
22
nativecodegen
33
native
4+
orcjit
5+
support
46
)
5-
7+
68
# Main API shared library.
79
add_mlir_upstream_c_api_library(MLIRCAPIExecutionEngine
810
ExecutionEngine.cpp

0 commit comments

Comments
 (0)