[Mlir-commits] [mlir] 1c82dd3 - [MLIR] Ensure that target_link_libraries() always has a keyword.
Stephen Neuendorffer
llvmlistbot at llvm.org
Fri Mar 6 09:14:09 PST 2020
Author: Stephen Neuendorffer
Date: 2020-03-06T09:14:01-08:00
New Revision: 1c82dd39f9777b9d4cdfd428847787a19ed0fca5
URL: https://github.com/llvm/llvm-project/commit/1c82dd39f9777b9d4cdfd428847787a19ed0fca5
DIFF: https://github.com/llvm/llvm-project/commit/1c82dd39f9777b9d4cdfd428847787a19ed0fca5.diff
LOG: [MLIR] Ensure that target_link_libraries() always has a keyword.
CMake allows calling target_link_libraries() without a keyword,
but this usage is not preferred when also called with a keyword,
and has surprising behavior. This patch explicitly specifies a
keyword when using target_link_libraries().
Differential Revision: https://reviews.llvm.org/D75725
Added:
Modified:
mlir/lib/Analysis/CMakeLists.txt
mlir/lib/Conversion/AffineToStandard/CMakeLists.txt
mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt
mlir/lib/Conversion/GPUToNVVM/CMakeLists.txt
mlir/lib/Conversion/GPUToROCDL/CMakeLists.txt
mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt
mlir/lib/Conversion/GPUToVulkan/CMakeLists.txt
mlir/lib/Conversion/LinalgToLLVM/CMakeLists.txt
mlir/lib/Conversion/LinalgToSPIRV/CMakeLists.txt
mlir/lib/Conversion/LoopToStandard/CMakeLists.txt
mlir/lib/Conversion/LoopsToGPU/CMakeLists.txt
mlir/lib/Conversion/StandardToLLVM/CMakeLists.txt
mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt
mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt
mlir/lib/Conversion/VectorToLoops/CMakeLists.txt
mlir/lib/Dialect/AffineOps/CMakeLists.txt
mlir/lib/Dialect/CMakeLists.txt
mlir/lib/Dialect/FxpMathOps/CMakeLists.txt
mlir/lib/Dialect/GPU/CMakeLists.txt
mlir/lib/Dialect/LLVMIR/CMakeLists.txt
mlir/lib/Dialect/Linalg/Analysis/CMakeLists.txt
mlir/lib/Dialect/Linalg/EDSC/CMakeLists.txt
mlir/lib/Dialect/Linalg/IR/CMakeLists.txt
mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
mlir/lib/Dialect/Linalg/Utils/CMakeLists.txt
mlir/lib/Dialect/LoopOps/CMakeLists.txt
mlir/lib/Dialect/LoopOps/Transforms/CMakeLists.txt
mlir/lib/Dialect/OpenMP/CMakeLists.txt
mlir/lib/Dialect/QuantOps/CMakeLists.txt
mlir/lib/Dialect/SDBM/CMakeLists.txt
mlir/lib/Dialect/SPIRV/CMakeLists.txt
mlir/lib/Dialect/SPIRV/Serialization/CMakeLists.txt
mlir/lib/Dialect/SPIRV/Transforms/CMakeLists.txt
mlir/lib/Dialect/Shape/CMakeLists.txt
mlir/lib/Dialect/StandardOps/CMakeLists.txt
mlir/lib/Dialect/VectorOps/CMakeLists.txt
mlir/lib/ExecutionEngine/CMakeLists.txt
mlir/lib/IR/CMakeLists.txt
mlir/lib/Parser/CMakeLists.txt
mlir/lib/Pass/CMakeLists.txt
mlir/lib/Quantizer/CMakeLists.txt
mlir/lib/Support/CMakeLists.txt
mlir/lib/TableGen/CMakeLists.txt
mlir/lib/Target/CMakeLists.txt
mlir/lib/Transforms/CMakeLists.txt
mlir/lib/Transforms/Utils/CMakeLists.txt
mlir/lib/Translation/CMakeLists.txt
mlir/test/lib/IR/CMakeLists.txt
mlir/test/lib/Pass/CMakeLists.txt
mlir/test/lib/TestDialect/CMakeLists.txt
mlir/test/lib/Transforms/CMakeLists.txt
mlir/tools/mlir-cuda-runner/CMakeLists.txt
mlir/tools/mlir-opt/CMakeLists.txt
mlir/tools/mlir-vulkan-runner/CMakeLists.txt
Removed:
################################################################################
diff --git a/mlir/lib/Analysis/CMakeLists.txt b/mlir/lib/Analysis/CMakeLists.txt
index 44ec43c96233..c7beabd37d98 100644
--- a/mlir/lib/Analysis/CMakeLists.txt
+++ b/mlir/lib/Analysis/CMakeLists.txt
@@ -33,7 +33,11 @@ add_dependencies(MLIRAnalysis
MLIRLoopOps
)
-target_link_libraries(MLIRAnalysis MLIRAffineOps MLIRLoopOps)
+target_link_libraries(MLIRAnalysis
+ PUBLIC
+ MLIRAffineOps
+ MLIRLoopOps
+ )
add_llvm_library(MLIRLoopAnalysis
AffineAnalysis.cpp
@@ -53,4 +57,7 @@ add_dependencies(MLIRLoopAnalysis
MLIRLoopOps
)
-target_link_libraries(MLIRLoopAnalysis MLIRAffineOps MLIRLoopOps)
+target_link_libraries(MLIRLoopAnalysis
+ PUBLIC
+ MLIRAffineOps
+ MLIRLoopOps)
diff --git a/mlir/lib/Conversion/AffineToStandard/CMakeLists.txt b/mlir/lib/Conversion/AffineToStandard/CMakeLists.txt
index 9d639e034b66..80408d76c2a9 100644
--- a/mlir/lib/Conversion/AffineToStandard/CMakeLists.txt
+++ b/mlir/lib/Conversion/AffineToStandard/CMakeLists.txt
@@ -15,7 +15,7 @@ add_dependencies(
)
target_link_libraries(
MLIRAffineToStandard
-
+ PUBLIC
MLIRAffineOps
MLIRLoopOps
MLIRPass
diff --git a/mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt b/mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt
index 65c976ce9a38..67b0bf27d8d0 100644
--- a/mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt
+++ b/mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt
@@ -12,6 +12,7 @@ endif()
add_mlir_conversion_library(MLIRGPUtoCUDATransforms ${SOURCES})
target_link_libraries(MLIRGPUtoCUDATransforms
+ PUBLIC
MLIRGPU
MLIRLLVMIR
MLIRNVVMIR
diff --git a/mlir/lib/Conversion/GPUToNVVM/CMakeLists.txt b/mlir/lib/Conversion/GPUToNVVM/CMakeLists.txt
index 339b2b79a439..0ae0e974f1d0 100644
--- a/mlir/lib/Conversion/GPUToNVVM/CMakeLists.txt
+++ b/mlir/lib/Conversion/GPUToNVVM/CMakeLists.txt
@@ -10,6 +10,7 @@ add_dependencies(MLIRGPUtoNVVMTransforms
MLIRGPUToNVVMIncGen)
target_link_libraries(MLIRGPUtoNVVMTransforms
+ PUBLIC
LLVMSupport
MLIRGPU
MLIRLLVMIR
diff --git a/mlir/lib/Conversion/GPUToROCDL/CMakeLists.txt b/mlir/lib/Conversion/GPUToROCDL/CMakeLists.txt
index 778689859a84..9acc53a4e788 100644
--- a/mlir/lib/Conversion/GPUToROCDL/CMakeLists.txt
+++ b/mlir/lib/Conversion/GPUToROCDL/CMakeLists.txt
@@ -2,6 +2,7 @@ add_mlir_conversion_library(MLIRGPUtoROCDLTransforms
LowerGpuOpsToROCDLOps.cpp
)
target_link_libraries(MLIRGPUtoROCDLTransforms
+ PUBLIC
LLVMSupport
MLIRGPU
MLIRLLVMIR
diff --git a/mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt b/mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt
index e59c48e4a614..c766469b66b2 100644
--- a/mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt
+++ b/mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt
@@ -11,6 +11,7 @@ add_dependencies(MLIRGPUtoSPIRVTransforms
MLIRGPUToSPIRVIncGen)
target_link_libraries(MLIRGPUtoSPIRVTransforms
+ PUBLIC
MLIRGPU
MLIRIR
MLIRPass
diff --git a/mlir/lib/Conversion/GPUToVulkan/CMakeLists.txt b/mlir/lib/Conversion/GPUToVulkan/CMakeLists.txt
index 69c1c4e8b06d..72680390c9d0 100644
--- a/mlir/lib/Conversion/GPUToVulkan/CMakeLists.txt
+++ b/mlir/lib/Conversion/GPUToVulkan/CMakeLists.txt
@@ -3,6 +3,7 @@ add_mlir_conversion_library(MLIRGPUtoVulkanTransforms
)
target_link_libraries(MLIRGPUtoVulkanTransforms
+ PUBLIC
MLIRGPU
MLIRIR
MLIRLLVMIR
diff --git a/mlir/lib/Conversion/LinalgToLLVM/CMakeLists.txt b/mlir/lib/Conversion/LinalgToLLVM/CMakeLists.txt
index c63411796465..4f21ca208bfd 100644
--- a/mlir/lib/Conversion/LinalgToLLVM/CMakeLists.txt
+++ b/mlir/lib/Conversion/LinalgToLLVM/CMakeLists.txt
@@ -19,4 +19,6 @@ set(LIBS
)
add_dependencies(MLIRLinalgToLLVM ${LIBS})
-target_link_libraries(MLIRLinalgToLLVM ${LIBS})
+target_link_libraries(MLIRLinalgToLLVM
+ PUBLIC
+ ${LIBS})
diff --git a/mlir/lib/Conversion/LinalgToSPIRV/CMakeLists.txt b/mlir/lib/Conversion/LinalgToSPIRV/CMakeLists.txt
index 5f00034abae9..52a813470f02 100644
--- a/mlir/lib/Conversion/LinalgToSPIRV/CMakeLists.txt
+++ b/mlir/lib/Conversion/LinalgToSPIRV/CMakeLists.txt
@@ -8,6 +8,7 @@ add_mlir_conversion_library(MLIRLinalgToSPIRVTransforms
)
target_link_libraries(MLIRLinalgToSPIRVTransforms
+ PUBLIC
MLIRIR
MLIRLinalgOps
MLIRLinalgUtils
diff --git a/mlir/lib/Conversion/LoopToStandard/CMakeLists.txt b/mlir/lib/Conversion/LoopToStandard/CMakeLists.txt
index 4297346a10bf..2b6361eae3d5 100644
--- a/mlir/lib/Conversion/LoopToStandard/CMakeLists.txt
+++ b/mlir/lib/Conversion/LoopToStandard/CMakeLists.txt
@@ -14,7 +14,7 @@ add_dependencies(
)
target_link_libraries(
MLIRLoopToStandard
-
+ PUBLIC
MLIRLoopOps
MLIRTransforms
LLVMCore
diff --git a/mlir/lib/Conversion/LoopsToGPU/CMakeLists.txt b/mlir/lib/Conversion/LoopsToGPU/CMakeLists.txt
index c2f3c2a7f852..3dde75ad1411 100644
--- a/mlir/lib/Conversion/LoopsToGPU/CMakeLists.txt
+++ b/mlir/lib/Conversion/LoopsToGPU/CMakeLists.txt
@@ -19,4 +19,6 @@ add_mlir_conversion_library(MLIRLoopsToGPU
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/LoopsToGPU
)
add_dependencies(MLIRLoopsToGPU ${LIBS})
-target_link_libraries(MLIRLoopsToGPU ${LIBS})
+target_link_libraries(MLIRLoopsToGPU
+ PUBLIC
+ ${LIBS})
diff --git a/mlir/lib/Conversion/StandardToLLVM/CMakeLists.txt b/mlir/lib/Conversion/StandardToLLVM/CMakeLists.txt
index 3e8f72bb60c5..dd9245b7e108 100644
--- a/mlir/lib/Conversion/StandardToLLVM/CMakeLists.txt
+++ b/mlir/lib/Conversion/StandardToLLVM/CMakeLists.txt
@@ -14,7 +14,7 @@ add_dependencies(
)
target_link_libraries(
MLIRStandardToLLVM
-
+ PUBLIC
MLIRLLVMIR
MLIRTransforms
LLVMCore
diff --git a/mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt b/mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt
index f02f68db7bb1..fcb1da848f9e 100644
--- a/mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt
+++ b/mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt
@@ -16,6 +16,7 @@ add_dependencies(MLIRStandardToSPIRVTransforms
MLIRStandardToSPIRVIncGen)
target_link_libraries(MLIRStandardToSPIRVTransforms
+ PUBLIC
MLIRIR
MLIRPass
MLIRSPIRV
diff --git a/mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt b/mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt
index 5a89f399516c..0da51e850cc1 100644
--- a/mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt
+++ b/mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt
@@ -14,4 +14,6 @@ set(LIBS
)
add_dependencies(MLIRVectorToLLVM ${LIBS})
-target_link_libraries(MLIRVectorToLLVM ${LIBS})
+target_link_libraries(MLIRVectorToLLVM
+ PUBLIC
+ ${LIBS})
diff --git a/mlir/lib/Conversion/VectorToLoops/CMakeLists.txt b/mlir/lib/Conversion/VectorToLoops/CMakeLists.txt
index 0dccea93b234..71aae34e4c0c 100644
--- a/mlir/lib/Conversion/VectorToLoops/CMakeLists.txt
+++ b/mlir/lib/Conversion/VectorToLoops/CMakeLists.txt
@@ -13,4 +13,6 @@ set(LIBS
)
add_dependencies(MLIRVectorToLoops ${LIBS})
-target_link_libraries(MLIRVectorToLoops ${LIBS})
+target_link_libraries(MLIRVectorToLoops
+ PUBLIC
+ ${LIBS})
diff --git a/mlir/lib/Dialect/AffineOps/CMakeLists.txt b/mlir/lib/Dialect/AffineOps/CMakeLists.txt
index 1c1c95cf3f8f..bfa86b247b41 100644
--- a/mlir/lib/Dialect/AffineOps/CMakeLists.txt
+++ b/mlir/lib/Dialect/AffineOps/CMakeLists.txt
@@ -15,7 +15,7 @@ add_dependencies(MLIRAffineOps
MLIRStandardOps
)
target_link_libraries(MLIRAffineOps
-
+ PUBLIC
MLIREDSC
MLIRIR
MLIRStandardOps
diff --git a/mlir/lib/Dialect/CMakeLists.txt b/mlir/lib/Dialect/CMakeLists.txt
index 59186ed37964..4ff04f990491 100644
--- a/mlir/lib/Dialect/CMakeLists.txt
+++ b/mlir/lib/Dialect/CMakeLists.txt
@@ -23,4 +23,7 @@ add_llvm_library(MLIRDialect
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect
)
-target_link_libraries(MLIRDialect MLIRIR)
+target_link_libraries(MLIRDialect
+ PUBLIC
+ MLIRIR
+ )
diff --git a/mlir/lib/Dialect/FxpMathOps/CMakeLists.txt b/mlir/lib/Dialect/FxpMathOps/CMakeLists.txt
index 021cade6e091..e0621225fb0f 100644
--- a/mlir/lib/Dialect/FxpMathOps/CMakeLists.txt
+++ b/mlir/lib/Dialect/FxpMathOps/CMakeLists.txt
@@ -7,6 +7,7 @@ add_mlir_dialect_library(MLIRFxpMathOps
)
target_link_libraries(MLIRFxpMathOps
+ PUBLIC
MLIRQuantOps
MLIRIR
MLIRPass
diff --git a/mlir/lib/Dialect/GPU/CMakeLists.txt b/mlir/lib/Dialect/GPU/CMakeLists.txt
index 41884a9ddb66..79291acbf5d4 100644
--- a/mlir/lib/Dialect/GPU/CMakeLists.txt
+++ b/mlir/lib/Dialect/GPU/CMakeLists.txt
@@ -18,6 +18,7 @@ add_dependencies(MLIRGPU
MLIRTransformUtils
LLVMSupport)
target_link_libraries(MLIRGPU
+ PUBLIC
MLIREDSC
MLIRIR
MLIRLLVMIR
diff --git a/mlir/lib/Dialect/LLVMIR/CMakeLists.txt b/mlir/lib/Dialect/LLVMIR/CMakeLists.txt
index 97b70cae9366..7c6c3c1d1e32 100644
--- a/mlir/lib/Dialect/LLVMIR/CMakeLists.txt
+++ b/mlir/lib/Dialect/LLVMIR/CMakeLists.txt
@@ -5,7 +5,14 @@ add_mlir_dialect_library(MLIRLLVMIR
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/LLVMIR
)
add_dependencies(MLIRLLVMIR MLIRControlFlowInterfacesIncGen MLIRLLVMOpsIncGen MLIRLLVMConversionsIncGen MLIROpenMP LLVMFrontendOpenMP LLVMAsmParser LLVMCore LLVMSupport)
-target_link_libraries(MLIRLLVMIR LLVMAsmParser LLVMCore LLVMSupport LLVMFrontendOpenMP MLIROpenMP MLIRIR)
+target_link_libraries(MLIRLLVMIR
+ PUBLIC
+ LLVMAsmParser
+ LLVMCore
+ LLVMSupport
+ LLVMFrontendOpenMP
+ MLIROpenMP
+ MLIRIR)
add_mlir_dialect_library(MLIRNVVMIR
IR/NVVMDialect.cpp
@@ -14,7 +21,13 @@ add_mlir_dialect_library(MLIRNVVMIR
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/LLVMIR
)
add_dependencies(MLIRNVVMIR MLIRNVVMOpsIncGen MLIRNVVMConversionsIncGen LLVMAsmParser LLVMCore LLVMSupport)
-target_link_libraries(MLIRNVVMIR LLVMAsmParser MLIRIR MLIRLLVMIR LLVMSupport LLVMCore)
+target_link_libraries(MLIRNVVMIR
+ PUBLIC
+ LLVMAsmParser
+ MLIRIR
+ MLIRLLVMIR
+ LLVMSupport
+ LLVMCore)
add_mlir_dialect_library(MLIRROCDLIR
IR/ROCDLDialect.cpp
@@ -23,4 +36,9 @@ add_mlir_dialect_library(MLIRROCDLIR
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/LLVMIR
)
add_dependencies(MLIRROCDLIR MLIRROCDLOpsIncGen MLIRROCDLConversionsIncGen LLVMAsmParser LLVMCore LLVMSupport)
-target_link_libraries(MLIRROCDLIR LLVMAsmParser LLVMCore LLVMSupport MLIRIR)
+target_link_libraries(MLIRROCDLIR
+ PUBLIC
+ LLVMAsmParser
+ LLVMCore
+ LLVMSupport
+ MLIRIR)
diff --git a/mlir/lib/Dialect/Linalg/Analysis/CMakeLists.txt b/mlir/lib/Dialect/Linalg/Analysis/CMakeLists.txt
index 96698a9ef5e8..4d5570529399 100644
--- a/mlir/lib/Dialect/Linalg/Analysis/CMakeLists.txt
+++ b/mlir/lib/Dialect/Linalg/Analysis/CMakeLists.txt
@@ -15,4 +15,6 @@ add_mlir_dialect_library(MLIRLinalgAnalysis
)
add_dependencies(MLIRLinalgAnalysis ${LIBS})
-target_link_libraries(MLIRLinalgAnalysis ${LIBS})
+target_link_libraries(MLIRLinalgAnalysis
+ PUBLIC
+ ${LIBS})
diff --git a/mlir/lib/Dialect/Linalg/EDSC/CMakeLists.txt b/mlir/lib/Dialect/Linalg/EDSC/CMakeLists.txt
index dc87d7fad224..078179b91eaa 100644
--- a/mlir/lib/Dialect/Linalg/EDSC/CMakeLists.txt
+++ b/mlir/lib/Dialect/Linalg/EDSC/CMakeLists.txt
@@ -18,4 +18,6 @@ add_mlir_dialect_library(MLIRLinalgEDSC
)
add_dependencies(MLIRLinalgEDSC ${LIBS})
-target_link_libraries(MLIRLinalgEDSC ${LIBS})
+target_link_libraries(MLIRLinalgEDSC
+ PUBLIC
+ ${LIBS})
diff --git a/mlir/lib/Dialect/Linalg/IR/CMakeLists.txt b/mlir/lib/Dialect/Linalg/IR/CMakeLists.txt
index 9dba1e52bdb7..ef7e90856308 100644
--- a/mlir/lib/Dialect/Linalg/IR/CMakeLists.txt
+++ b/mlir/lib/Dialect/Linalg/IR/CMakeLists.txt
@@ -21,4 +21,6 @@ add_dependencies(MLIRLinalgOps
MLIRLinalgStructuredOpsIncGen
MLIRLinalgStructuredOpsInterfaceIncGen
)
-target_link_libraries(MLIRLinalgOps ${LIBS})
+target_link_libraries(MLIRLinalgOps
+ PUBLIC
+ ${LIBS})
diff --git a/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
index 763ef558e47c..2711dd1e6531 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
@@ -34,4 +34,6 @@ add_dependencies(MLIRLinalgTransforms
${LIBS}
MLIRLinalgTransformPatternsIncGen
)
-target_link_libraries(MLIRLinalgTransforms ${LIBS})
+target_link_libraries(MLIRLinalgTransforms
+ PUBLIC
+ ${LIBS})
diff --git a/mlir/lib/Dialect/Linalg/Utils/CMakeLists.txt b/mlir/lib/Dialect/Linalg/Utils/CMakeLists.txt
index 76581e226d37..1f0f174cface 100644
--- a/mlir/lib/Dialect/Linalg/Utils/CMakeLists.txt
+++ b/mlir/lib/Dialect/Linalg/Utils/CMakeLists.txt
@@ -20,4 +20,6 @@ add_mlir_dialect_library(MLIRLinalgUtils
)
add_dependencies(MLIRLinalgUtils ${LIBS})
-target_link_libraries(MLIRLinalgUtils ${LIBS})
+target_link_libraries(MLIRLinalgUtils
+ PUBLIC
+ ${LIBS})
diff --git a/mlir/lib/Dialect/LoopOps/CMakeLists.txt b/mlir/lib/Dialect/LoopOps/CMakeLists.txt
index 98367d1c2268..248f1479b0cf 100644
--- a/mlir/lib/Dialect/LoopOps/CMakeLists.txt
+++ b/mlir/lib/Dialect/LoopOps/CMakeLists.txt
@@ -15,7 +15,7 @@ add_dependencies(MLIRLoopOps
LLVMSupport
)
target_link_libraries(MLIRLoopOps
-
+ PUBLIC
MLIREDSC
MLIRIR
MLIRStandardOps
diff --git a/mlir/lib/Dialect/LoopOps/Transforms/CMakeLists.txt b/mlir/lib/Dialect/LoopOps/Transforms/CMakeLists.txt
index eb2aaf6930f2..db559a37dbfb 100644
--- a/mlir/lib/Dialect/LoopOps/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/LoopOps/Transforms/CMakeLists.txt
@@ -8,6 +8,7 @@ add_mlir_dialect_library(MLIRLoopOpsTransforms
)
target_link_libraries(MLIRLoopOpsTransforms
+ PUBLIC
MLIRPass
MLIRLoopOps
)
diff --git a/mlir/lib/Dialect/OpenMP/CMakeLists.txt b/mlir/lib/Dialect/OpenMP/CMakeLists.txt
index bf55088a7cb0..deec87c31a80 100644
--- a/mlir/lib/Dialect/OpenMP/CMakeLists.txt
+++ b/mlir/lib/Dialect/OpenMP/CMakeLists.txt
@@ -6,4 +6,6 @@ add_mlir_dialect_library(MLIROpenMP
)
add_dependencies(MLIROpenMP MLIROpenMPOpsIncGen)
-target_link_libraries(MLIROpenMP MLIRIR)
+target_link_libraries(MLIROpenMP
+ PUBLIC
+ MLIRIR)
diff --git a/mlir/lib/Dialect/QuantOps/CMakeLists.txt b/mlir/lib/Dialect/QuantOps/CMakeLists.txt
index 12cb44fd42db..188de3f93dc9 100644
--- a/mlir/lib/Dialect/QuantOps/CMakeLists.txt
+++ b/mlir/lib/Dialect/QuantOps/CMakeLists.txt
@@ -20,6 +20,7 @@ add_dependencies(MLIRQuantOps
MLIRStandardOps)
target_link_libraries(MLIRQuantOps
+ PUBLIC
MLIRIR
MLIRPass
MLIRSupport
diff --git a/mlir/lib/Dialect/SDBM/CMakeLists.txt b/mlir/lib/Dialect/SDBM/CMakeLists.txt
index 648d9f268c2f..1d3230604db0 100644
--- a/mlir/lib/Dialect/SDBM/CMakeLists.txt
+++ b/mlir/lib/Dialect/SDBM/CMakeLists.txt
@@ -6,4 +6,6 @@ add_mlir_dialect_library(MLIRSDBM
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/SDBM
)
add_dependencies(MLIRSDBM MLIRIR)
-target_link_libraries(MLIRSDBM MLIRIR)
+target_link_libraries(MLIRSDBM
+ PUBLIC
+ MLIRIR)
diff --git a/mlir/lib/Dialect/SPIRV/CMakeLists.txt b/mlir/lib/Dialect/SPIRV/CMakeLists.txt
index 7e77f3e7866e..0e51df3e9ffc 100644
--- a/mlir/lib/Dialect/SPIRV/CMakeLists.txt
+++ b/mlir/lib/Dialect/SPIRV/CMakeLists.txt
@@ -26,6 +26,7 @@ add_dependencies(MLIRSPIRV
MLIRSPIRVTargetAndABIIncGen)
target_link_libraries(MLIRSPIRV
+ PUBLIC
MLIRIR
MLIRParser
MLIRSupport
diff --git a/mlir/lib/Dialect/SPIRV/Serialization/CMakeLists.txt b/mlir/lib/Dialect/SPIRV/Serialization/CMakeLists.txt
index 3d9ea7939535..54909be8efdc 100644
--- a/mlir/lib/Dialect/SPIRV/Serialization/CMakeLists.txt
+++ b/mlir/lib/Dialect/SPIRV/Serialization/CMakeLists.txt
@@ -12,6 +12,7 @@ add_dependencies(MLIRSPIRVSerialization
MLIRSPIRVSerializationGen)
target_link_libraries(MLIRSPIRVSerialization
+ PUBLIC
MLIRIR
MLIRSPIRV
MLIRSupport
diff --git a/mlir/lib/Dialect/SPIRV/Transforms/CMakeLists.txt b/mlir/lib/Dialect/SPIRV/Transforms/CMakeLists.txt
index e9d6492c0b1c..a722f9dac2be 100644
--- a/mlir/lib/Dialect/SPIRV/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/SPIRV/Transforms/CMakeLists.txt
@@ -7,6 +7,7 @@ add_mlir_dialect_library(MLIRSPIRVTransforms
)
target_link_libraries(MLIRSPIRVTransforms
+ PUBLIC
MLIRPass
MLIRSPIRV
)
diff --git a/mlir/lib/Dialect/Shape/CMakeLists.txt b/mlir/lib/Dialect/Shape/CMakeLists.txt
index f42323287a98..12778a875465 100644
--- a/mlir/lib/Dialect/Shape/CMakeLists.txt
+++ b/mlir/lib/Dialect/Shape/CMakeLists.txt
@@ -6,4 +6,6 @@ add_mlir_dialect_library(MLIRShape
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Shape
)
add_dependencies(MLIRShape MLIRShapeOpsIncGen LLVMSupport)
-target_link_libraries(MLIRShape LLVMSupport)
+target_link_libraries(MLIRShape
+ PUBLIC
+ LLVMSupport)
diff --git a/mlir/lib/Dialect/StandardOps/CMakeLists.txt b/mlir/lib/Dialect/StandardOps/CMakeLists.txt
index 9b8ffcdb1980..a2f79f23138f 100644
--- a/mlir/lib/Dialect/StandardOps/CMakeLists.txt
+++ b/mlir/lib/Dialect/StandardOps/CMakeLists.txt
@@ -16,7 +16,7 @@ add_dependencies(MLIRStandardOps
LLVMSupport
)
target_link_libraries(MLIRStandardOps
-
+ PUBLIC
MLIREDSC
MLIRIR
LLVMSupport
diff --git a/mlir/lib/Dialect/VectorOps/CMakeLists.txt b/mlir/lib/Dialect/VectorOps/CMakeLists.txt
index 8bdce35f71ff..87f3ca3dbaa3 100644
--- a/mlir/lib/Dialect/VectorOps/CMakeLists.txt
+++ b/mlir/lib/Dialect/VectorOps/CMakeLists.txt
@@ -11,4 +11,10 @@ add_mlir_dialect_library(MLIRVectorOps
add_dependencies(MLIRVectorOps MLIRVectorOpsIncGen)
add_dependencies(MLIRVectorOps MLIRVectorTransformPatternsIncGen)
-target_link_libraries(MLIRVectorOps MLIRIR MLIRStandardOps MLIRAffineOps MLIRLoopOps MLIRLoopAnalysis)
+target_link_libraries(MLIRVectorOps
+ PUBLIC
+ MLIRIR
+ MLIRStandardOps
+ MLIRAffineOps
+ MLIRLoopOps
+ MLIRLoopAnalysis)
diff --git a/mlir/lib/ExecutionEngine/CMakeLists.txt b/mlir/lib/ExecutionEngine/CMakeLists.txt
index 37df71642440..93dae061aec6 100644
--- a/mlir/lib/ExecutionEngine/CMakeLists.txt
+++ b/mlir/lib/ExecutionEngine/CMakeLists.txt
@@ -14,7 +14,7 @@ add_llvm_library(MLIRExecutionEngine
${MLIR_MAIN_INCLUDE_DIR}/mlir/ExecutionEngine
)
target_link_libraries(MLIRExecutionEngine
-
+ PUBLIC
MLIRLLVMIR
MLIRTargetLLVMIR
LLVMBitReader
@@ -41,7 +41,7 @@ target_compile_definitions(mlir_c_runner_utils PRIVATE mlir_c_runner_utils_EXPOR
add_llvm_library(mlir_runner_utils SHARED RunnerUtils.cpp)
target_link_libraries(mlir_runner_utils
-
+ PUBLIC
mlir_c_runner_utils_static
)
target_compile_definitions(mlir_runner_utils PRIVATE mlir_runner_utils_EXPORTS)
diff --git a/mlir/lib/IR/CMakeLists.txt b/mlir/lib/IR/CMakeLists.txt
index 415d9d66e22c..b4c1859dd175 100644
--- a/mlir/lib/IR/CMakeLists.txt
+++ b/mlir/lib/IR/CMakeLists.txt
@@ -6,4 +6,4 @@ add_llvm_library(MLIRIR
${MLIR_MAIN_INCLUDE_DIR}/mlir/IR
)
add_dependencies(MLIRIR MLIRCallOpInterfacesIncGen MLIROpAsmInterfacesIncGen MLIRSupport LLVMSupport)
-target_link_libraries(MLIRIR MLIRSupport LLVMSupport)
+target_link_libraries(MLIRIR PUBLIC MLIRSupport LLVMSupport)
diff --git a/mlir/lib/Parser/CMakeLists.txt b/mlir/lib/Parser/CMakeLists.txt
index 9fd29ae78791..2b3554bded5f 100644
--- a/mlir/lib/Parser/CMakeLists.txt
+++ b/mlir/lib/Parser/CMakeLists.txt
@@ -7,4 +7,7 @@ add_llvm_library(MLIRParser
${MLIR_MAIN_INCLUDE_DIR}/mlir/Parser
)
add_dependencies(MLIRParser MLIRIR MLIRAnalysis)
-target_link_libraries(MLIRParser MLIRIR MLIRAnalysis)
+target_link_libraries(MLIRParser
+ PUBLIC
+ MLIRIR
+ MLIRAnalysis)
diff --git a/mlir/lib/Pass/CMakeLists.txt b/mlir/lib/Pass/CMakeLists.txt
index 05122f5a7ed4..8db845b029f0 100644
--- a/mlir/lib/Pass/CMakeLists.txt
+++ b/mlir/lib/Pass/CMakeLists.txt
@@ -6,4 +6,8 @@ add_llvm_library(MLIRPass
${MLIR_MAIN_INCLUDE_DIR}/mlir/Pass
)
add_dependencies(MLIRPass MLIRAnalysis MLIRIR LLVMSupport)
-target_link_libraries(MLIRPass MLIRAnalysis MLIRIR LLVMSupport)
+target_link_libraries(MLIRPass
+ PUBLIC
+ MLIRAnalysis
+ MLIRIR
+ LLVMSupport)
diff --git a/mlir/lib/Quantizer/CMakeLists.txt b/mlir/lib/Quantizer/CMakeLists.txt
index 6e2c86484138..e98d3683431a 100644
--- a/mlir/lib/Quantizer/CMakeLists.txt
+++ b/mlir/lib/Quantizer/CMakeLists.txt
@@ -17,6 +17,7 @@ add_dependencies(MLIRQuantizerSupport
MLIRSupport
MLIRStandardOps)
target_link_libraries(MLIRQuantizerSupport
+ PUBLIC
MLIRIR
MLIRQuantOps
MLIRSupport
@@ -35,6 +36,7 @@ add_dependencies(MLIRQuantizerFxpMathConfig
MLIRFxpMathOpsIncGen
MLIRQuantizerSupport)
target_link_libraries(MLIRQuantizerFxpMathConfig
+ PUBLIC
MLIRIR
MLIRFxpMathOps
MLIRQuantOps
@@ -54,6 +56,7 @@ add_dependencies(MLIRQuantizerTransforms
MLIRQuantizerSupport
MLIRPass)
target_link_libraries(MLIRQuantizerTransforms
+ PUBLIC
MLIRIR
MLIRQuantizerFxpMathConfig
MLIRQuantizerSupport
diff --git a/mlir/lib/Support/CMakeLists.txt b/mlir/lib/Support/CMakeLists.txt
index b8c0b17a68f8..500914e5d3d1 100644
--- a/mlir/lib/Support/CMakeLists.txt
+++ b/mlir/lib/Support/CMakeLists.txt
@@ -15,7 +15,10 @@ add_llvm_library(MLIRSupport
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Support
)
-target_link_libraries(MLIRSupport LLVMSupport ${LLVM_PTHREAD_LIB})
+target_link_libraries(MLIRSupport
+ PUBLIC
+ LLVMSupport
+ ${LLVM_PTHREAD_LIB})
add_llvm_library(MLIROptLib
MlirOptMain.cpp
@@ -24,6 +27,7 @@ add_llvm_library(MLIROptLib
${MLIR_MAIN_INCLUDE_DIR}/mlir/Support
)
target_link_libraries(MLIROptLib
+ PUBLIC
MLIRPass
MLIRParser
LLVMSupport
@@ -36,12 +40,18 @@ add_llvm_library(MLIRTranslateClParser
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Support
)
-target_link_libraries(MLIRTranslateClParser LLVMSupport MLIRIR MLIRTranslation MLIRParser)
+target_link_libraries(MLIRTranslateClParser
+ PUBLIC
+ LLVMSupport
+ MLIRIR
+ MLIRTranslation
+ MLIRParser)
add_llvm_library(MLIRJitRunner
JitRunner.cpp
)
-target_link_libraries(MLIRJitRunner PRIVATE
+target_link_libraries(MLIRJitRunner
+ PUBLIC
MLIRExecutionEngine
MLIRIR
MLIRParser
diff --git a/mlir/lib/TableGen/CMakeLists.txt b/mlir/lib/TableGen/CMakeLists.txt
index 6317c669192e..6e3bf27720d2 100644
--- a/mlir/lib/TableGen/CMakeLists.txt
+++ b/mlir/lib/TableGen/CMakeLists.txt
@@ -16,4 +16,7 @@ add_llvm_library(LLVMMLIRTableGen
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/TableGen
)
-target_link_libraries(LLVMMLIRTableGen LLVMSupport LLVMTableGen)
+target_link_libraries(LLVMMLIRTableGen
+ PUBLIC
+ LLVMSupport
+ LLVMTableGen)
diff --git a/mlir/lib/Target/CMakeLists.txt b/mlir/lib/Target/CMakeLists.txt
index 53786b94ad70..5e76ce2e051d 100644
--- a/mlir/lib/Target/CMakeLists.txt
+++ b/mlir/lib/Target/CMakeLists.txt
@@ -8,6 +8,7 @@ add_llvm_library(MLIRTargetLLVMIRModuleTranslation
intrinsics_gen
)
target_link_libraries(MLIRTargetLLVMIRModuleTranslation
+ PUBLIC
MLIRLLVMIR LLVMCore LLVMIRReader LLVMSupport LLVMTransformUtils
MLIRTranslation)
add_llvm_library(MLIRTargetLLVMIR
@@ -17,7 +18,9 @@ add_llvm_library(MLIRTargetLLVMIR
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Target/LLVMIR
)
-target_link_libraries(MLIRTargetLLVMIR MLIRTargetLLVMIRModuleTranslation)
+target_link_libraries(MLIRTargetLLVMIR
+ PUBLIC
+ MLIRTargetLLVMIRModuleTranslation)
add_llvm_library(MLIRTargetNVVMIR
LLVMIR/ConvertToNVVMIR.cpp
@@ -27,6 +30,7 @@ add_llvm_library(MLIRTargetNVVMIR
intrinsics_gen
)
target_link_libraries(MLIRTargetNVVMIR
+ PUBLIC
MLIRGPU
MLIRIR
MLIRLLVMIR
@@ -42,6 +46,7 @@ add_llvm_library(MLIRTargetROCDLIR
intrinsics_gen
)
target_link_libraries(MLIRTargetROCDLIR
+ PUBLIC
MLIRGPU
MLIRIR
MLIRLLVMIR
diff --git a/mlir/lib/Transforms/CMakeLists.txt b/mlir/lib/Transforms/CMakeLists.txt
index 7d671003e7f0..8ead50ce5755 100644
--- a/mlir/lib/Transforms/CMakeLists.txt
+++ b/mlir/lib/Transforms/CMakeLists.txt
@@ -32,6 +32,7 @@ add_dependencies(MLIRTransforms
MLIRLoopLikeInterfaceIncGen
MLIRStandardOpsIncGen)
target_link_libraries(MLIRTransforms
+ PUBLIC
MLIRAffineOps
MLIRAnalysis
MLIRLoopOps
diff --git a/mlir/lib/Transforms/Utils/CMakeLists.txt b/mlir/lib/Transforms/Utils/CMakeLists.txt
index bf4abf8f2807..79564b2359a5 100644
--- a/mlir/lib/Transforms/Utils/CMakeLists.txt
+++ b/mlir/lib/Transforms/Utils/CMakeLists.txt
@@ -13,6 +13,7 @@ add_llvm_library(MLIRTransformUtils
add_dependencies(MLIRTransformUtils MLIRStandardOpsIncGen)
target_link_libraries(MLIRTransformUtils
+ PUBLIC
MLIRAffineOps
MLIRAnalysis
MLIRLoopAnalysis
diff --git a/mlir/lib/Translation/CMakeLists.txt b/mlir/lib/Translation/CMakeLists.txt
index 122db2e6a319..506a635abfb4 100644
--- a/mlir/lib/Translation/CMakeLists.txt
+++ b/mlir/lib/Translation/CMakeLists.txt
@@ -4,4 +4,7 @@ add_llvm_library(MLIRTranslation
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Translation
)
-target_link_libraries(MLIRTranslation LLVMSupport)
+target_link_libraries(MLIRTranslation
+ PUBLIC
+ LLVMSupport
+ )
diff --git a/mlir/test/lib/IR/CMakeLists.txt b/mlir/test/lib/IR/CMakeLists.txt
index b6b3c4377c6b..e537b8cba9a0 100644
--- a/mlir/test/lib/IR/CMakeLists.txt
+++ b/mlir/test/lib/IR/CMakeLists.txt
@@ -11,5 +11,6 @@ add_dependencies(MLIRTestIR
MLIRTestDialect
)
target_link_libraries(MLIRTestIR
+ PUBLIC
MLIRPass
)
diff --git a/mlir/test/lib/Pass/CMakeLists.txt b/mlir/test/lib/Pass/CMakeLists.txt
index 3289a7add942..7d79e1137f40 100644
--- a/mlir/test/lib/Pass/CMakeLists.txt
+++ b/mlir/test/lib/Pass/CMakeLists.txt
@@ -5,6 +5,7 @@ add_llvm_library(MLIRTestPass
${MLIR_MAIN_INCLUDE_DIR}/mlir/Pass
)
target_link_libraries(MLIRTestPass
+ PUBLIC
MLIRIR
MLIRPass
)
diff --git a/mlir/test/lib/TestDialect/CMakeLists.txt b/mlir/test/lib/TestDialect/CMakeLists.txt
index d81500912f4d..1a5f669a6ced 100644
--- a/mlir/test/lib/TestDialect/CMakeLists.txt
+++ b/mlir/test/lib/TestDialect/CMakeLists.txt
@@ -21,6 +21,7 @@ add_dependencies(MLIRTestDialect
MLIRTypeInferOpInterfaceIncGen
)
target_link_libraries(MLIRTestDialect
+ PUBLIC
MLIRDialect
MLIRIR
MLIRLinalgTransforms
diff --git a/mlir/test/lib/Transforms/CMakeLists.txt b/mlir/test/lib/Transforms/CMakeLists.txt
index 91672ea129c0..054fac2c49b9 100644
--- a/mlir/test/lib/Transforms/CMakeLists.txt
+++ b/mlir/test/lib/Transforms/CMakeLists.txt
@@ -32,6 +32,7 @@ add_dependencies(MLIRTestTransforms MLIRStandardOpsIncGen)
add_dependencies(MLIRTestTransforms MLIRTestLinalgTransformPatternsIncGen)
add_dependencies(MLIRTestTransforms MLIRTestVectorTransformPatternsIncGen)
target_link_libraries(MLIRTestTransforms
+ PUBLIC
MLIRAffineOps
MLIRAnalysis
MLIREDSC
diff --git a/mlir/tools/mlir-cuda-runner/CMakeLists.txt b/mlir/tools/mlir-cuda-runner/CMakeLists.txt
index 3c6dcbaec7ba..40cbceda50fa 100644
--- a/mlir/tools/mlir-cuda-runner/CMakeLists.txt
+++ b/mlir/tools/mlir-cuda-runner/CMakeLists.txt
@@ -31,6 +31,7 @@ if(MLIR_CUDA_RUNNER_ENABLED)
LLVMSupport
)
target_link_libraries(cuda-runtime-wrappers
+ PUBLIC
LLVMSupport
${CUDA_RUNTIME_LIBRARY}
)
diff --git a/mlir/tools/mlir-opt/CMakeLists.txt b/mlir/tools/mlir-opt/CMakeLists.txt
index b415bf97b63d..30a97d91301d 100644
--- a/mlir/tools/mlir-opt/CMakeLists.txt
+++ b/mlir/tools/mlir-opt/CMakeLists.txt
@@ -15,6 +15,7 @@ add_llvm_library(MLIRMlirOptMain
mlir-opt.cpp
)
target_link_libraries(MLIRMlirOptMain
+ PUBLIC
${LIB_LIBS}
)
diff --git a/mlir/tools/mlir-vulkan-runner/CMakeLists.txt b/mlir/tools/mlir-vulkan-runner/CMakeLists.txt
index cadbeee5bf24..2b45a937d84b 100644
--- a/mlir/tools/mlir-vulkan-runner/CMakeLists.txt
+++ b/mlir/tools/mlir-vulkan-runner/CMakeLists.txt
@@ -44,6 +44,7 @@ if (MLIR_VULKAN_RUNNER_ENABLED)
)
target_link_libraries(vulkan-runtime-wrappers
+ PUBLIC
LLVMSupport
MLIRSPIRVSerialization
LLVMCore
More information about the Mlir-commits
mailing list