Skip to content

Commit 37ce8d6

Browse files
[MLIR] Fix linkage for libMLIR.so
Generally: 1) don't use target_link_libraries() and add_mlir_library() on the same target, use LINK_LIBS PUBLIC instead. 2) don't use LINK_LIBS to specify LLVM libraries. Use LINK_COMPONENTS instead 3) no need to link against LLVMSupport. We pull it in by default. Differential Revision: https://reviews.llvm.org/D80076
1 parent f88c7fe commit 37ce8d6

File tree

5 files changed

+3
-12
lines changed

5 files changed

+3
-12
lines changed

mlir/lib/Conversion/LinalgToStandard/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ add_mlir_conversion_library(MLIRLinalgToStandard
77
DEPENDS
88
MLIRConversionPassIncGen
99

10+
LINK_COMPONENTS
11+
Core
12+
1013
LINK_LIBS PUBLIC
1114
MLIREDSC
1215
MLIRIR
1316
MLIRLinalgOps
1417
MLIRPass
1518
MLIRSCF
1619
MLIRTransforms
17-
LLVMCore
18-
LLVMSupport
1920
)

mlir/lib/Dialect/StandardOps/Transforms/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,5 @@ add_mlir_dialect_library(MLIRStandardOpsTransforms
1212
MLIRIR
1313
MLIRPass
1414
MLIRStandardOps
15-
MLIRSupport
1615
MLIRTransforms
17-
LLVMSupport
1816
)

mlir/lib/ExecutionEngine/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ add_mlir_library(MLIRJitRunner
5555
Core
5656
OrcJIT
5757
JITLink
58-
Support
5958

6059
LINK_LIBS PUBLIC
6160
MLIRExecutionEngine

mlir/lib/IR/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,4 @@ add_mlir_library(MLIRIR
3636

3737
LINK_LIBS PUBLIC
3838
MLIRSupport
39-
LLVMSupport
4039
)

mlir/lib/Support/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ add_mlir_library(MLIRSupport
1313
ADDITIONAL_HEADER_DIRS
1414
${MLIR_MAIN_INCLUDE_DIR}/mlir/Support
1515

16-
LINK_COMPONENTS
17-
Support
18-
1916
LINK_LIBS PUBLIC
2017
${LLVM_PTHREAD_LIB})
2118

@@ -25,9 +22,6 @@ add_mlir_library(MLIROptLib
2522
ADDITIONAL_HEADER_DIRS
2623
${MLIR_MAIN_INCLUDE_DIR}/mlir/Support
2724

28-
LINK_COMPONENTS
29-
Support
30-
3125
LINK_LIBS PUBLIC
3226
MLIRPass
3327
MLIRParser

0 commit comments

Comments
 (0)