[Mlir-commits] [mlir] 4594d0e - [MLIR] Move from add_dependencies() to DEPENDS
Stephen Neuendorffer
llvmlistbot at llvm.org
Fri Mar 6 13:25:27 PST 2020
Author: Stephen Neuendorffer
Date: 2020-03-06T13:25:17-08:00
New Revision: 4594d0e943b641a3e4d18f8ab66413e59149ed0a
URL: https://github.com/llvm/llvm-project/commit/4594d0e943b641a3e4d18f8ab66413e59149ed0a
DIFF: https://github.com/llvm/llvm-project/commit/4594d0e943b641a3e4d18f8ab66413e59149ed0a.diff
LOG: [MLIR] Move from add_dependencies() to DEPENDS
add_llvm_library and add_llvm_executable may need to create new targets with
appropriate dependencies. As a result, it is not sufficient in some
configurations (namely LLVM_BUILD_LLVM_DYLIB=on) to only call
add_dependencies(). Instead, the explicit TableGen dependencies must
be passed to add_llvm_library() or add_llvm_executable() using the DEPENDS
keyword.
Differential Revision: https://reviews.llvm.org/D74930
Added:
Modified:
mlir/examples/toy/Ch2/CMakeLists.txt
mlir/examples/toy/Ch3/CMakeLists.txt
mlir/examples/toy/Ch4/CMakeLists.txt
mlir/examples/toy/Ch5/CMakeLists.txt
mlir/examples/toy/Ch6/CMakeLists.txt
mlir/examples/toy/Ch7/CMakeLists.txt
mlir/lib/Analysis/CMakeLists.txt
mlir/lib/Conversion/GPUToNVVM/CMakeLists.txt
mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt
mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt
mlir/lib/Dialect/AffineOps/CMakeLists.txt
mlir/lib/Dialect/FxpMathOps/CMakeLists.txt
mlir/lib/Dialect/GPU/CMakeLists.txt
mlir/lib/Dialect/LLVMIR/CMakeLists.txt
mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
mlir/lib/Dialect/LoopOps/CMakeLists.txt
mlir/lib/Dialect/OpenMP/CMakeLists.txt
mlir/lib/Dialect/QuantOps/CMakeLists.txt
mlir/lib/Dialect/SPIRV/CMakeLists.txt
mlir/lib/Dialect/SPIRV/Serialization/CMakeLists.txt
mlir/lib/Dialect/StandardOps/CMakeLists.txt
mlir/lib/Dialect/VectorOps/CMakeLists.txt
mlir/lib/IR/CMakeLists.txt
mlir/lib/Quantizer/CMakeLists.txt
mlir/lib/Transforms/CMakeLists.txt
mlir/lib/Transforms/Utils/CMakeLists.txt
mlir/test/lib/TestDialect/CMakeLists.txt
mlir/test/lib/Transforms/CMakeLists.txt
mlir/tools/mlir-cuda-runner/CMakeLists.txt
Removed:
################################################################################
diff --git a/mlir/examples/toy/Ch2/CMakeLists.txt b/mlir/examples/toy/Ch2/CMakeLists.txt
index 7154902017ee..ea03e4e4c13f 100644
--- a/mlir/examples/toy/Ch2/CMakeLists.txt
+++ b/mlir/examples/toy/Ch2/CMakeLists.txt
@@ -9,10 +9,13 @@ add_toy_chapter(toyc-ch2
parser/AST.cpp
mlir/MLIRGen.cpp
mlir/Dialect.cpp
+
+ DEPENDS
+ ToyCh2OpsIncGen
+
)
include_directories(include/)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/)
-add_dependencies(toyc-ch2 ToyCh2OpsIncGen)
target_link_libraries(toyc-ch2
PRIVATE
MLIRAnalysis
diff --git a/mlir/examples/toy/Ch3/CMakeLists.txt b/mlir/examples/toy/Ch3/CMakeLists.txt
index 823edfd343a3..e1bfe1bd12eb 100644
--- a/mlir/examples/toy/Ch3/CMakeLists.txt
+++ b/mlir/examples/toy/Ch3/CMakeLists.txt
@@ -14,10 +14,12 @@ add_toy_chapter(toyc-ch3
mlir/MLIRGen.cpp
mlir/Dialect.cpp
mlir/ToyCombine.cpp
+
+ DEPENDS
+ ToyCh3OpsIncGen
+ ToyCh3CombineIncGen
)
-add_dependencies(toyc-ch3 ToyCh3OpsIncGen)
-add_dependencies(toyc-ch3 ToyCh3CombineIncGen)
include_directories(include/)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/)
diff --git a/mlir/examples/toy/Ch4/CMakeLists.txt b/mlir/examples/toy/Ch4/CMakeLists.txt
index c9b0e71e5291..a78bedfd8814 100644
--- a/mlir/examples/toy/Ch4/CMakeLists.txt
+++ b/mlir/examples/toy/Ch4/CMakeLists.txt
@@ -15,12 +15,14 @@ add_toy_chapter(toyc-ch4
mlir/Dialect.cpp
mlir/ShapeInferencePass.cpp
mlir/ToyCombine.cpp
+
+ DEPENDS
+ ToyCh4OpsIncGen
+ ToyCh4ShapeInferenceInterfaceIncGen
+ ToyCh4CombineIncGen
+ MLIRCallOpInterfacesIncGen
)
-add_dependencies(toyc-ch4 ToyCh4OpsIncGen)
-add_dependencies(toyc-ch4 ToyCh4ShapeInferenceInterfaceIncGen)
-add_dependencies(toyc-ch4 ToyCh4CombineIncGen)
-add_dependencies(toyc-ch4 MLIRCallOpInterfacesIncGen)
include_directories(include/)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/)
diff --git a/mlir/examples/toy/Ch5/CMakeLists.txt b/mlir/examples/toy/Ch5/CMakeLists.txt
index 4c2cf4978140..6b9ded359f66 100644
--- a/mlir/examples/toy/Ch5/CMakeLists.txt
+++ b/mlir/examples/toy/Ch5/CMakeLists.txt
@@ -16,12 +16,14 @@ add_toy_chapter(toyc-ch5
mlir/LowerToAffineLoops.cpp
mlir/ShapeInferencePass.cpp
mlir/ToyCombine.cpp
+
+ DEPENDS
+ ToyCh5ShapeInferenceInterfaceIncGen
+ ToyCh5OpsIncGen
+ ToyCh5CombineIncGen
+ MLIRCallOpInterfacesIncGen
)
-add_dependencies(toyc-ch5 ToyCh5ShapeInferenceInterfaceIncGen)
-add_dependencies(toyc-ch5 ToyCh5OpsIncGen)
-add_dependencies(toyc-ch5 ToyCh5CombineIncGen)
-add_dependencies(toyc-ch5 MLIRCallOpInterfacesIncGen)
include_directories(include/)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/)
diff --git a/mlir/examples/toy/Ch6/CMakeLists.txt b/mlir/examples/toy/Ch6/CMakeLists.txt
index e46200d3f9ad..727331f23a8a 100644
--- a/mlir/examples/toy/Ch6/CMakeLists.txt
+++ b/mlir/examples/toy/Ch6/CMakeLists.txt
@@ -18,12 +18,14 @@ add_toy_chapter(toyc-ch6
mlir/LowerToLLVM.cpp
mlir/ShapeInferencePass.cpp
mlir/ToyCombine.cpp
+
+ DEPENDS
+ ToyCh6ShapeInferenceInterfaceIncGen
+ ToyCh6OpsIncGen
+ ToyCh6CombineIncGen
+ MLIRCallOpInterfacesIncGen
)
-add_dependencies(toyc-ch6 ToyCh6ShapeInferenceInterfaceIncGen)
-add_dependencies(toyc-ch6 ToyCh6OpsIncGen)
-add_dependencies(toyc-ch6 ToyCh6CombineIncGen)
-add_dependencies(toyc-ch6 MLIRCallOpInterfacesIncGen)
include_directories(include/)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/)
diff --git a/mlir/examples/toy/Ch7/CMakeLists.txt b/mlir/examples/toy/Ch7/CMakeLists.txt
index 7f67cc9519ec..cc1e9bf7bc99 100644
--- a/mlir/examples/toy/Ch7/CMakeLists.txt
+++ b/mlir/examples/toy/Ch7/CMakeLists.txt
@@ -18,12 +18,14 @@ add_toy_chapter(toyc-ch7
mlir/LowerToLLVM.cpp
mlir/ShapeInferencePass.cpp
mlir/ToyCombine.cpp
+
+ DEPENDS
+ ToyCh7ShapeInferenceInterfaceIncGen
+ ToyCh7OpsIncGen
+ ToyCh7CombineIncGen
+ MLIRCallOpInterfacesIncGen
)
-add_dependencies(toyc-ch7 ToyCh7ShapeInferenceInterfaceIncGen)
-add_dependencies(toyc-ch7 ToyCh7OpsIncGen)
-add_dependencies(toyc-ch7 ToyCh7CombineIncGen)
-add_dependencies(toyc-ch7 MLIRCallOpInterfacesIncGen)
include_directories(include/)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/)
diff --git a/mlir/lib/Analysis/CMakeLists.txt b/mlir/lib/Analysis/CMakeLists.txt
index c66086f69482..4fbd16cef012 100644
--- a/mlir/lib/Analysis/CMakeLists.txt
+++ b/mlir/lib/Analysis/CMakeLists.txt
@@ -24,8 +24,8 @@ add_llvm_library(MLIRAnalysis
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Analysis
- )
-add_dependencies(MLIRAnalysis
+
+ DEPENDS
MLIRCallOpInterfacesIncGen
MLIRControlFlowInterfacesIncGen
MLIRTypeInferOpInterfaceIncGen
@@ -46,8 +46,8 @@ add_llvm_library(MLIRLoopAnalysis
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Analysis
- )
-add_dependencies(MLIRLoopAnalysis
+
+ DEPENDS
MLIRCallOpInterfacesIncGen
MLIRControlFlowInterfacesIncGen
MLIRTypeInferOpInterfaceIncGen
diff --git a/mlir/lib/Conversion/GPUToNVVM/CMakeLists.txt b/mlir/lib/Conversion/GPUToNVVM/CMakeLists.txt
index 0ae0e974f1d0..75d82e80260b 100644
--- a/mlir/lib/Conversion/GPUToNVVM/CMakeLists.txt
+++ b/mlir/lib/Conversion/GPUToNVVM/CMakeLists.txt
@@ -4,10 +4,10 @@ add_public_tablegen_target(MLIRGPUToNVVMIncGen)
add_mlir_conversion_library(MLIRGPUtoNVVMTransforms
LowerGpuOpsToNVVMOps.cpp
- )
-add_dependencies(MLIRGPUtoNVVMTransforms
- MLIRGPUToNVVMIncGen)
+ DEPENDS
+ MLIRGPUToNVVMIncGen
+ )
target_link_libraries(MLIRGPUtoNVVMTransforms
PUBLIC
diff --git a/mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt b/mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt
index c766469b66b2..a0c5b6a1c32c 100644
--- a/mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt
+++ b/mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt
@@ -5,10 +5,10 @@ add_public_tablegen_target(MLIRGPUToSPIRVIncGen)
add_mlir_conversion_library(MLIRGPUtoSPIRVTransforms
ConvertGPUToSPIRV.cpp
ConvertGPUToSPIRVPass.cpp
- )
-add_dependencies(MLIRGPUtoSPIRVTransforms
- MLIRGPUToSPIRVIncGen)
+ DEPENDS
+ MLIRGPUToSPIRVIncGen
+ )
target_link_libraries(MLIRGPUtoSPIRVTransforms
PUBLIC
diff --git a/mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt b/mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt
index fcb1da848f9e..308f1b0074ed 100644
--- a/mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt
+++ b/mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt
@@ -10,10 +10,10 @@ add_mlir_conversion_library(MLIRStandardToSPIRVTransforms
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/SPIRV
${MLIR_MAIN_INCLUDE_DIR}/mlir/IR
- )
-add_dependencies(MLIRStandardToSPIRVTransforms
- MLIRStandardToSPIRVIncGen)
+ DEPENDS
+ MLIRStandardToSPIRVIncGen
+ )
target_link_libraries(MLIRStandardToSPIRVTransforms
PUBLIC
diff --git a/mlir/lib/Dialect/AffineOps/CMakeLists.txt b/mlir/lib/Dialect/AffineOps/CMakeLists.txt
index 5746377eac24..f0656083d12d 100644
--- a/mlir/lib/Dialect/AffineOps/CMakeLists.txt
+++ b/mlir/lib/Dialect/AffineOps/CMakeLists.txt
@@ -5,8 +5,8 @@ add_mlir_dialect_library(MLIRAffineOps
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/AffineOps
- )
-add_dependencies(MLIRAffineOps
+
+ DEPENDS
MLIRAffineOpsIncGen
MLIRLoopLikeInterfaceIncGen
)
diff --git a/mlir/lib/Dialect/FxpMathOps/CMakeLists.txt b/mlir/lib/Dialect/FxpMathOps/CMakeLists.txt
index 0ccf79416fad..66016c7b5f1a 100644
--- a/mlir/lib/Dialect/FxpMathOps/CMakeLists.txt
+++ b/mlir/lib/Dialect/FxpMathOps/CMakeLists.txt
@@ -4,6 +4,9 @@ add_mlir_dialect_library(MLIRFxpMathOps
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/FxpMathOps
+
+ DEPENDS
+ MLIRFxpMathOpsIncGen
)
target_link_libraries(MLIRFxpMathOps
@@ -14,6 +17,3 @@ target_link_libraries(MLIRFxpMathOps
MLIRSupport
MLIRStandardOps
)
-add_dependencies(MLIRFxpMathOps
- MLIRFxpMathOpsIncGen
- )
diff --git a/mlir/lib/Dialect/GPU/CMakeLists.txt b/mlir/lib/Dialect/GPU/CMakeLists.txt
index 4ca74e9f767e..120e347e5aaf 100644
--- a/mlir/lib/Dialect/GPU/CMakeLists.txt
+++ b/mlir/lib/Dialect/GPU/CMakeLists.txt
@@ -7,8 +7,8 @@ add_mlir_dialect_library(MLIRGPU
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/GPU
-)
-add_dependencies(MLIRGPU
+
+ DEPENDS
MLIRGPUOpsIncGen
)
target_link_libraries(MLIRGPU
@@ -21,4 +21,5 @@ target_link_libraries(MLIRGPU
MLIRStandardOps
MLIRSupport
MLIRTransformUtils
- LLVMSupport)
+ LLVMSupport
+ )
diff --git a/mlir/lib/Dialect/LLVMIR/CMakeLists.txt b/mlir/lib/Dialect/LLVMIR/CMakeLists.txt
index 60b5bdca2802..8c030f30244c 100644
--- a/mlir/lib/Dialect/LLVMIR/CMakeLists.txt
+++ b/mlir/lib/Dialect/LLVMIR/CMakeLists.txt
@@ -3,8 +3,8 @@ add_mlir_dialect_library(MLIRLLVMIR
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/LLVMIR
- )
-add_dependencies(MLIRLLVMIR
+
+ DEPENDS
MLIRControlFlowInterfacesIncGen
MLIRLLVMOpsIncGen
MLIRLLVMConversionsIncGen
@@ -25,8 +25,8 @@ add_mlir_dialect_library(MLIRNVVMIR
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/LLVMIR
- )
-add_dependencies(MLIRNVVMIR
+
+ DEPENDS
MLIRNVVMOpsIncGen
MLIRNVVMConversionsIncGen
)
@@ -44,8 +44,8 @@ add_mlir_dialect_library(MLIRROCDLIR
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/LLVMIR
- )
-add_dependencies(MLIRROCDLIR
+
+ DEPENDS
MLIRROCDLOpsIncGen
MLIRROCDLConversionsIncGen
)
diff --git a/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
index 4a7aaad436a7..7a864ad2def2 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
@@ -7,11 +7,9 @@ add_mlir_dialect_library(MLIRLinalgTransforms
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Linalg
+
DEPENDS
intrinsics_gen
- )
-
-add_dependencies(MLIRLinalgTransforms
MLIRLinalgTransformPatternsIncGen
)
target_link_libraries(MLIRLinalgTransforms
diff --git a/mlir/lib/Dialect/LoopOps/CMakeLists.txt b/mlir/lib/Dialect/LoopOps/CMakeLists.txt
index f41e22d9c8bd..2d0fdc86acde 100644
--- a/mlir/lib/Dialect/LoopOps/CMakeLists.txt
+++ b/mlir/lib/Dialect/LoopOps/CMakeLists.txt
@@ -5,8 +5,8 @@ add_mlir_dialect_library(MLIRLoopOps
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/LoopOps
- )
-add_dependencies(MLIRLoopOps
+
+ DEPENDS
MLIRLoopLikeInterfaceIncGen
MLIRLoopOpsIncGen
)
diff --git a/mlir/lib/Dialect/OpenMP/CMakeLists.txt b/mlir/lib/Dialect/OpenMP/CMakeLists.txt
index deec87c31a80..68a939ed4299 100644
--- a/mlir/lib/Dialect/OpenMP/CMakeLists.txt
+++ b/mlir/lib/Dialect/OpenMP/CMakeLists.txt
@@ -3,9 +3,11 @@ add_mlir_dialect_library(MLIROpenMP
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/OpenMP
- )
-add_dependencies(MLIROpenMP MLIROpenMPOpsIncGen)
+ DEPENDS
+ MLIROpenMPOpsIncGen
+ )
target_link_libraries(MLIROpenMP
PUBLIC
- MLIRIR)
+ MLIRIR
+ )
diff --git a/mlir/lib/Dialect/QuantOps/CMakeLists.txt b/mlir/lib/Dialect/QuantOps/CMakeLists.txt
index f7fbd6c044ec..1ae171d92437 100644
--- a/mlir/lib/Dialect/QuantOps/CMakeLists.txt
+++ b/mlir/lib/Dialect/QuantOps/CMakeLists.txt
@@ -11,8 +11,8 @@ add_mlir_dialect_library(MLIRQuantOps
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/QuantOps
- )
-add_dependencies(MLIRQuantOps
+
+ DEPENDS
MLIRQuantOpsIncGen
)
target_link_libraries(MLIRQuantOps
diff --git a/mlir/lib/Dialect/SPIRV/CMakeLists.txt b/mlir/lib/Dialect/SPIRV/CMakeLists.txt
index 0e51df3e9ffc..137e94c29d12 100644
--- a/mlir/lib/Dialect/SPIRV/CMakeLists.txt
+++ b/mlir/lib/Dialect/SPIRV/CMakeLists.txt
@@ -13,9 +13,7 @@ add_mlir_dialect_library(MLIRSPIRV
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/SPIRV
- )
-add_dependencies(MLIRSPIRV
MLIRControlFlowInterfacesIncGen
MLIRSPIRVAvailabilityIncGen
MLIRSPIRVCanonicalizationIncGen
@@ -23,14 +21,15 @@ add_dependencies(MLIRSPIRV
MLIRSPIRVEnumsIncGen
MLIRSPIRVOpsIncGen
MLIRSPIRVOpUtilsGen
- MLIRSPIRVTargetAndABIIncGen)
-
+ MLIRSPIRVTargetAndABIIncGen
+ )
target_link_libraries(MLIRSPIRV
PUBLIC
MLIRIR
MLIRParser
MLIRSupport
- MLIRTransforms)
+ MLIRTransforms
+ )
add_subdirectory(Serialization)
add_subdirectory(Transforms)
diff --git a/mlir/lib/Dialect/SPIRV/Serialization/CMakeLists.txt b/mlir/lib/Dialect/SPIRV/Serialization/CMakeLists.txt
index 54909be8efdc..8f24491f4715 100644
--- a/mlir/lib/Dialect/SPIRV/Serialization/CMakeLists.txt
+++ b/mlir/lib/Dialect/SPIRV/Serialization/CMakeLists.txt
@@ -6,14 +6,14 @@ add_mlir_dialect_library(MLIRSPIRVSerialization
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/SPIRV
- )
-
-add_dependencies(MLIRSPIRVSerialization
- MLIRSPIRVSerializationGen)
+ DEPENDS
+ MLIRSPIRVSerializationGen
+ )
target_link_libraries(MLIRSPIRVSerialization
PUBLIC
MLIRIR
MLIRSPIRV
MLIRSupport
- MLIRTranslation)
+ MLIRTranslation
+ )
diff --git a/mlir/lib/Dialect/StandardOps/CMakeLists.txt b/mlir/lib/Dialect/StandardOps/CMakeLists.txt
index 578e90bd45b1..54a9a8aa7f14 100644
--- a/mlir/lib/Dialect/StandardOps/CMakeLists.txt
+++ b/mlir/lib/Dialect/StandardOps/CMakeLists.txt
@@ -5,8 +5,8 @@ add_mlir_dialect_library(MLIRStandardOps
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/StandardOps
- )
-add_dependencies(MLIRStandardOps
+
+ DEPENDS
MLIRCallOpInterfacesIncGen
MLIRControlFlowInterfacesIncGen
MLIRStandardOpsIncGen
diff --git a/mlir/lib/Dialect/VectorOps/CMakeLists.txt b/mlir/lib/Dialect/VectorOps/CMakeLists.txt
index 87f3ca3dbaa3..425eec35d37f 100644
--- a/mlir/lib/Dialect/VectorOps/CMakeLists.txt
+++ b/mlir/lib/Dialect/VectorOps/CMakeLists.txt
@@ -6,15 +6,16 @@ add_mlir_dialect_library(MLIRVectorOps
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/VectorOps
- )
-
-add_dependencies(MLIRVectorOps MLIRVectorOpsIncGen)
-add_dependencies(MLIRVectorOps MLIRVectorTransformPatternsIncGen)
+ DEPENDS
+ MLIRVectorOpsIncGen
+ MLIRVectorTransformPatternsIncGen
+ )
target_link_libraries(MLIRVectorOps
PUBLIC
MLIRIR
MLIRStandardOps
MLIRAffineOps
MLIRLoopOps
- MLIRLoopAnalysis)
+ MLIRLoopAnalysis
+ )
diff --git a/mlir/lib/IR/CMakeLists.txt b/mlir/lib/IR/CMakeLists.txt
index 4f473f6be56f..68ccaec9b798 100644
--- a/mlir/lib/IR/CMakeLists.txt
+++ b/mlir/lib/IR/CMakeLists.txt
@@ -4,12 +4,13 @@ add_llvm_library(MLIRIR
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/IR
- )
-add_dependencies(MLIRIR
+
+ DEPENDS
MLIRCallOpInterfacesIncGen
MLIROpAsmInterfacesIncGen
)
target_link_libraries(MLIRIR
PUBLIC
MLIRSupport
- LLVMSupport)
+ LLVMSupport
+ )
diff --git a/mlir/lib/Quantizer/CMakeLists.txt b/mlir/lib/Quantizer/CMakeLists.txt
index 23dca84d8418..f5ec9a4af11a 100644
--- a/mlir/lib/Quantizer/CMakeLists.txt
+++ b/mlir/lib/Quantizer/CMakeLists.txt
@@ -25,17 +25,20 @@ add_llvm_library(MLIRQuantizerFxpMathConfig
Configurations/FxpMathConfig.cpp
ADDITIONAL_HEADER_DIRS
- )
-add_dependencies(MLIRQuantizerFxpMathConfig
+ DEPENDS
MLIRFxpMathOpsIncGen
)
+
target_link_libraries(MLIRQuantizerFxpMathConfig
PUBLIC
MLIRIR
MLIRFxpMathOps
MLIRQuantOps
MLIRQuantizerSupport
+ MLIRStandardOps
+ MLIRSupport
+ LLVMSupport
)
# Transforms.
diff --git a/mlir/lib/Transforms/CMakeLists.txt b/mlir/lib/Transforms/CMakeLists.txt
index 8ead50ce5755..35b24e0a6ca1 100644
--- a/mlir/lib/Transforms/CMakeLists.txt
+++ b/mlir/lib/Transforms/CMakeLists.txt
@@ -26,11 +26,12 @@ add_llvm_library(MLIRTransforms
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Transforms
- )
-add_dependencies(MLIRTransforms
+ DEPENDS
MLIRLoopLikeInterfaceIncGen
- MLIRStandardOpsIncGen)
+ MLIRStandardOpsIncGen
+ )
+
target_link_libraries(MLIRTransforms
PUBLIC
MLIRAffineOps
diff --git a/mlir/lib/Transforms/Utils/CMakeLists.txt b/mlir/lib/Transforms/Utils/CMakeLists.txt
index 79564b2359a5..3893e4e371cc 100644
--- a/mlir/lib/Transforms/Utils/CMakeLists.txt
+++ b/mlir/lib/Transforms/Utils/CMakeLists.txt
@@ -9,9 +9,11 @@ add_llvm_library(MLIRTransformUtils
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Transforms
+
+ DEPENDS
+ MLIRStandardOpsIncGen
)
-add_dependencies(MLIRTransformUtils MLIRStandardOpsIncGen)
target_link_libraries(MLIRTransformUtils
PUBLIC
MLIRAffineOps
diff --git a/mlir/test/lib/TestDialect/CMakeLists.txt b/mlir/test/lib/TestDialect/CMakeLists.txt
index 1a5f669a6ced..e666f9709683 100644
--- a/mlir/test/lib/TestDialect/CMakeLists.txt
+++ b/mlir/test/lib/TestDialect/CMakeLists.txt
@@ -14,14 +14,15 @@ add_public_tablegen_target(MLIRTestOpsIncGen)
add_llvm_library(MLIRTestDialect
TestDialect.cpp
TestPatterns.cpp
-)
-add_dependencies(MLIRTestDialect
+
+ DEPENDS
MLIRControlFlowInterfacesIncGen
MLIRTestOpsIncGen
MLIRTypeInferOpInterfaceIncGen
)
target_link_libraries(MLIRTestDialect
PUBLIC
+ MLIRAnalysis
MLIRDialect
MLIRIR
MLIRLinalgTransforms
diff --git a/mlir/test/lib/Transforms/CMakeLists.txt b/mlir/test/lib/Transforms/CMakeLists.txt
index 054fac2c49b9..e98623c7f1ba 100644
--- a/mlir/test/lib/Transforms/CMakeLists.txt
+++ b/mlir/test/lib/Transforms/CMakeLists.txt
@@ -22,15 +22,18 @@ add_llvm_library(MLIRTestTransforms
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Transforms
+
+ DEPENDS
+ MLIRStandardOpsIncGen
+ MLIRTestLinalgTransformPatternsIncGen
+ MLIRTestVectorTransformPatternsIncGen
)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../TestDialect)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/../TestDialect)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../DeclarativeTransforms)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/../DeclarativeTransforms)
-add_dependencies(MLIRTestTransforms MLIRStandardOpsIncGen)
-add_dependencies(MLIRTestTransforms MLIRTestLinalgTransformPatternsIncGen)
-add_dependencies(MLIRTestTransforms MLIRTestVectorTransformPatternsIncGen)
+
target_link_libraries(MLIRTestTransforms
PUBLIC
MLIRAffineOps
diff --git a/mlir/tools/mlir-cuda-runner/CMakeLists.txt b/mlir/tools/mlir-cuda-runner/CMakeLists.txt
index 40cbceda50fa..f669cfbea57b 100644
--- a/mlir/tools/mlir-cuda-runner/CMakeLists.txt
+++ b/mlir/tools/mlir-cuda-runner/CMakeLists.txt
@@ -69,8 +69,10 @@ if(MLIR_CUDA_RUNNER_ENABLED)
add_llvm_tool(mlir-cuda-runner
mlir-cuda-runner.cpp
- )
- add_dependencies(mlir-cuda-runner cuda-runtime-wrappers)
+
+ DEPENDS
+ cuda-runtime-wrappers
+ )
target_include_directories(mlir-cuda-runner
PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
)
More information about the Mlir-commits
mailing list