Skip to content
This repository was archived by the owner on Apr 23, 2021. It is now read-only.

Commit 6beae9b

Browse files
Update CMakeLists.txt for shared library build
There are several circular dependencies between libraries. These are explicitly marked as STATIC. Note that add_llvm_library is redundant with add_dependencies, so we don't have to have libraries in both places.
1 parent 797757b commit 6beae9b

File tree

23 files changed

+77
-45
lines changed

23 files changed

+77
-45
lines changed

examples/Linalg/Linalg1/lib/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ set(LIBS
1717
MLIRAnalysis
1818
MLIRControlFlowToCFG
1919
MLIREDSC
20+
MLIRLinalg
2021
MLIRLLVMIR
2122
MLIRParser
2223
MLIRPass
@@ -26,13 +27,13 @@ set(LIBS
2627
MLIRTransforms
2728
)
2829

29-
add_llvm_library(Linalg1LLVMConversion
30+
add_llvm_library(Linalg1LLVMConversion STATIC
3031
ConvertToLLVMDialect.cpp
3132
)
3233
target_link_libraries(Linalg1LLVMConversion PUBLIC MLIRLLVMIR
33-
MLIRControlFlowToCFG MLIRStandardOps)
34+
Linalg1 MLIRControlFlowToCFG MLIRStandardOps MLIRStandardToLLVM MLIRLinalg)
3435

35-
add_llvm_library(Linalg1
36+
add_llvm_library(Linalg1 STATIC
3637
Analysis.cpp
3738
SliceOp.cpp
3839
ViewOp.cpp

lib/Analysis/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,4 @@ add_llvm_library(MLIRAnalysis STATIC
1616
ADDITIONAL_HEADER_DIRS
1717
${MLIR_MAIN_INCLUDE_DIR}/mlir/Analysis
1818
)
19-
add_dependencies(MLIRAnalysis MLIRAffineOps MLIRLoopOps)
20-
target_link_libraries(MLIRAnalysis MLIRAffineOps MLIRLoopOps)
19+
target_link_libraries(MLIRAnalysis MLIRAffineOps MLIRLoopOps MLIRPass)

lib/Conversion/GPUToNVVM/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@ target_link_libraries(MLIRGPUtoNVVMTransforms
66
MLIRGPU
77
MLIRLLVMIR
88
MLIRNVVMIR
9+
MLIRStandardToLLVM
10+
MLIRTransforms
911
MLIRPass
1012
)

lib/Conversion/StandardToSPIRV/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ target_link_libraries(MLIRSPIRVConversion
1919
MLIRPass
2020
MLIRSPIRV
2121
MLIRSupport
22+
MLIRTransforms
2223
MLIRTransformUtils
2324
MLIRSPIRV
2425
MLIRStandardOps

lib/Conversion/VectorToLLVM/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ add_llvm_library(MLIRVectorToLLVM
66
)
77
set(LIBS
88
MLIRLLVMIR
9+
MLIRStandardToLLVM
910
MLIRTransforms
1011
LLVMCore
1112
LLVMSupport

lib/Dialect/AffineOps/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_llvm_library(MLIRAffineOps
1+
add_llvm_library(MLIRAffineOps STATIC
22
AffineOps.cpp
33
DialectRegistration.cpp
44

@@ -7,4 +7,3 @@ add_llvm_library(MLIRAffineOps
77
)
88
add_dependencies(MLIRAffineOps MLIRAffineOpsIncGen MLIRIR MLIRStandardOps)
99
target_link_libraries(MLIRAffineOps MLIRIR MLIRStandardOps)
10-

lib/Dialect/FxpMathOps/CMakeLists.txt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ add_llvm_library(MLIRFxpMathOps
66
ADDITIONAL_HEADER_DIRS
77
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/FxpMathOps
88
)
9-
add_dependencies(MLIRFxpMathOps
10-
MLIRFxpMathOpsIncGen
11-
MLIRQuantOps
12-
MLIRIR
13-
MLIRPass
14-
MLIRSupport
15-
MLIRStandardOps)
9+
add_dependencies(
10+
MLIRFxpMathOps
11+
MLIRFxpMathOpsIncGen)
12+
target_link_libraries(
13+
MLIRFxpMathOps
14+
MLIRQuantOps
15+
MLIRIR
16+
MLIRPass
17+
MLIRSupport
18+
MLIRStandardOps)

lib/Dialect/GPU/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ add_llvm_library(MLIRGPU
77
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/GPU
88
)
99
add_dependencies(MLIRGPU MLIRGPUOpsIncGen MLIRIR LLVMSupport)
10-
target_link_libraries(MLIRGPU MLIRIR MLIRStandardOps LLVMSupport)
10+
target_link_libraries(MLIRGPU MLIRIR MLIRPass MLIRStandardOps LLVMSupport)

lib/Dialect/LLVMIR/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ add_llvm_library(MLIRLLVMIR
55
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/LLVMIR
66
)
77
add_dependencies(MLIRLLVMIR MLIRLLVMOpsIncGen MLIRLLVMConversionsIncGen LLVMAsmParser LLVMCore LLVMSupport)
8-
target_link_libraries(MLIRLLVMIR LLVMAsmParser LLVMCore LLVMSupport)
8+
target_link_libraries(MLIRLLVMIR MLIRIR LLVMAsmParser LLVMCore LLVMSupport)
99

1010
add_llvm_library(MLIRNVVMIR
1111
IR/NVVMDialect.cpp
@@ -14,4 +14,4 @@ add_llvm_library(MLIRNVVMIR
1414
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/LLVMIR
1515
)
1616
add_dependencies(MLIRNVVMIR MLIRNVVMOpsIncGen MLIRNVVMConversionsIncGen LLVMAsmParser LLVMCore LLVMSupport)
17-
target_link_libraries(MLIRNVVMIR LLVMAsmParser LLVMCore LLVMSupport)
17+
target_link_libraries(MLIRNVVMIR MLIRLLVMIR MLIRIR LLVMAsmParser LLVMCore LLVMSupport)

lib/Dialect/Linalg/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_llvm_library(MLIRLinalg
1+
add_llvm_library(MLIRLinalg STATIC
22
LinalgRegistration.cpp
33
Analysis/DependenceAnalysis.cpp
44
IR/LinalgOps.cpp
@@ -17,8 +17,12 @@ add_llvm_library(MLIRLinalg
1717

1818
add_dependencies(MLIRLinalg
1919

20-
MLIRAffineOps
2120
MLIRLinalgOpsIncGen
2221
MLIRLinalgLibraryOpsIncGen
22+
)
23+
target_link_libraries(MLIRLinalg
24+
25+
MLIRAffineOps
26+
MLIRIR
2327
MLIRStandardToLLVM
2428
)

0 commit comments

Comments
 (0)