diff --git a/mlir/examples/toy/Ch6/CMakeLists.txt b/mlir/examples/toy/Ch6/CMakeLists.txt --- a/mlir/examples/toy/Ch6/CMakeLists.txt +++ b/mlir/examples/toy/Ch6/CMakeLists.txt @@ -41,4 +41,9 @@ MLIRPass MLIRTargetLLVMIR MLIRTransforms + LLVMOrcJIT + LLVMSupport + LLVMX86CodeGen + LLVMX86Desc + LLVMX86Info ) diff --git a/mlir/examples/toy/Ch7/CMakeLists.txt b/mlir/examples/toy/Ch7/CMakeLists.txt --- a/mlir/examples/toy/Ch7/CMakeLists.txt +++ b/mlir/examples/toy/Ch7/CMakeLists.txt @@ -38,6 +38,12 @@ MLIRIR MLIRParser MLIRPass + MLIRSupport MLIRTargetLLVMIR MLIRTransforms + LLVMOrcJIT + LLVMSupport + LLVMX86CodeGen + LLVMX86Desc + LLVMX86Info ) diff --git a/mlir/lib/Analysis/CMakeLists.txt b/mlir/lib/Analysis/CMakeLists.txt --- a/mlir/lib/Analysis/CMakeLists.txt +++ b/mlir/lib/Analysis/CMakeLists.txt @@ -22,6 +22,13 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Analysis + + LINK_LIBS + MLIRAffineOps + MLIRIR + MLIRLoopOps + MLIRSupport + LLVMSupport ) add_dependencies(MLIRAnalysis MLIRAffineOps @@ -30,8 +37,6 @@ MLIRLoopOps ) -target_link_libraries(MLIRAnalysis MLIRAffineOps MLIRLoopOps) - add_llvm_library(MLIRLoopAnalysis AffineAnalysis.cpp AffineStructures.cpp @@ -41,6 +46,14 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Analysis + + LINK_LIBS + MLIRAffineOps + MLIRIR + MLIRLoopOps + MLIRStandardOps + MLIRSupport + LLVMSupport ) add_dependencies(MLIRLoopAnalysis MLIRAffineOps @@ -48,5 +61,3 @@ MLIRTypeInferOpInterfaceIncGen MLIRLoopOps ) - -target_link_libraries(MLIRLoopAnalysis MLIRAffineOps MLIRLoopOps) diff --git a/mlir/lib/Conversion/AffineToStandard/CMakeLists.txt b/mlir/lib/Conversion/AffineToStandard/CMakeLists.txt --- a/mlir/lib/Conversion/AffineToStandard/CMakeLists.txt +++ b/mlir/lib/Conversion/AffineToStandard/CMakeLists.txt @@ -3,24 +3,22 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/AffineToStandard -) -add_dependencies( - MLIRAffineToStandard + LINK_LIBS MLIRAffineOps + MLIRLoopOps + MLIRPass MLIRStandardOps + MLIRTransforms MLIRIR LLVMCore LLVMSupport -) -target_link_libraries( + ) +add_dependencies( MLIRAffineToStandard MLIRAffineOps - MLIRLoopOps - MLIRPass MLIRStandardOps - MLIRTransforms MLIRIR LLVMCore LLVMSupport diff --git a/mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt b/mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt --- a/mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt +++ b/mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt @@ -10,11 +10,15 @@ list(APPEND SOURCES "ConvertKernelFuncToCubin.cpp") endif() -add_mlir_conversion_library(MLIRGPUtoCUDATransforms ${SOURCES}) -target_link_libraries(MLIRGPUtoCUDATransforms +add_mlir_conversion_library(MLIRGPUtoCUDATransforms + ${SOURCES} + LINK_LIBS + LLVMNVPTXCodeGen + LLVMNVPTXDesc + LLVMNVPTXInfo MLIRGPU MLIRLLVMIR MLIRNVVMIR MLIRPass MLIRTargetNVVMIR -) + ) diff --git a/mlir/lib/Conversion/GPUToNVVM/CMakeLists.txt b/mlir/lib/Conversion/GPUToNVVM/CMakeLists.txt --- a/mlir/lib/Conversion/GPUToNVVM/CMakeLists.txt +++ b/mlir/lib/Conversion/GPUToNVVM/CMakeLists.txt @@ -4,17 +4,21 @@ add_mlir_conversion_library(MLIRGPUtoNVVMTransforms LowerGpuOpsToNVVMOps.cpp - ) - -add_dependencies(MLIRGPUtoNVVMTransforms - MLIRGPUToNVVMIncGen) -target_link_libraries(MLIRGPUtoNVVMTransforms + LINK_LIBS + LLVMCore LLVMSupport MLIRGPU + MLIRIR MLIRLLVMIR MLIRNVVMIR MLIRPass + MLIRStandardOps MLIRStandardToLLVM + MLIRSupport + MLIRTransforms MLIRTransformUtils ) + +add_dependencies(MLIRGPUtoNVVMTransforms + MLIRGPUToNVVMIncGen) diff --git a/mlir/lib/Conversion/GPUToROCDL/CMakeLists.txt b/mlir/lib/Conversion/GPUToROCDL/CMakeLists.txt --- a/mlir/lib/Conversion/GPUToROCDL/CMakeLists.txt +++ b/mlir/lib/Conversion/GPUToROCDL/CMakeLists.txt @@ -1,11 +1,16 @@ add_mlir_conversion_library(MLIRGPUtoROCDLTransforms LowerGpuOpsToROCDLOps.cpp - ) -target_link_libraries(MLIRGPUtoROCDLTransforms + + LINK_LIBS + LLVMCore LLVMSupport MLIRGPU + MLIRIR MLIRLLVMIR MLIRROCDLIR MLIRPass MLIRStandardToLLVM + MLIRStandardOps + MLIRTransforms + MLIRTransformUtils ) diff --git a/mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt b/mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt --- a/mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt +++ b/mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt @@ -5,18 +5,19 @@ add_mlir_conversion_library(MLIRGPUtoSPIRVTransforms ConvertGPUToSPIRV.cpp ConvertGPUToSPIRVPass.cpp - ) - -add_dependencies(MLIRGPUtoSPIRVTransforms - MLIRGPUToSPIRVIncGen) -target_link_libraries(MLIRGPUtoSPIRVTransforms + LINK_LIBS MLIRGPU MLIRIR + MLIRLoopOps MLIRPass MLIRSPIRV MLIRStandardOps MLIRStandardToSPIRVTransforms MLIRSupport MLIRTransforms + LLVMSupport ) + +add_dependencies(MLIRGPUtoSPIRVTransforms + MLIRGPUToSPIRVIncGen) diff --git a/mlir/lib/Conversion/LinalgToLLVM/CMakeLists.txt b/mlir/lib/Conversion/LinalgToLLVM/CMakeLists.txt --- a/mlir/lib/Conversion/LinalgToLLVM/CMakeLists.txt +++ b/mlir/lib/Conversion/LinalgToLLVM/CMakeLists.txt @@ -3,20 +3,19 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/LinalgToLLVM -) -set(LIBS + + LINK_LIBS MLIRAffineToStandard MLIREDSC MLIRIR MLIRLinalgOps MLIRLLVMIR MLIRLoopToStandard + MLIRPass + MLIRStandardOps MLIRStandardToLLVM MLIRVectorToLLVM MLIRTransforms LLVMCore LLVMSupport ) - -add_dependencies(MLIRLinalgToLLVM ${LIBS}) -target_link_libraries(MLIRLinalgToLLVM ${LIBS}) diff --git a/mlir/lib/Conversion/LinalgToSPIRV/CMakeLists.txt b/mlir/lib/Conversion/LinalgToSPIRV/CMakeLists.txt --- a/mlir/lib/Conversion/LinalgToSPIRV/CMakeLists.txt +++ b/mlir/lib/Conversion/LinalgToSPIRV/CMakeLists.txt @@ -5,13 +5,15 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/SPIRV ${MLIR_MAIN_INCLUDE_DIR}/mlir/IR - ) -target_link_libraries(MLIRLinalgToSPIRVTransforms + LINK_LIBS MLIRIR MLIRLinalgOps MLIRLinalgUtils MLIRPass MLIRSPIRV MLIRSupport + MLIRTransforms + MLIRTransformUtils + LLVMSupport ) diff --git a/mlir/lib/Conversion/LoopToStandard/CMakeLists.txt b/mlir/lib/Conversion/LoopToStandard/CMakeLists.txt --- a/mlir/lib/Conversion/LoopToStandard/CMakeLists.txt +++ b/mlir/lib/Conversion/LoopToStandard/CMakeLists.txt @@ -3,16 +3,17 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/LoopToStandard -) -add_dependencies( - MLIRLoopToStandard + LINK_LIBS + MLIRIR MLIRLoopOps + MLIRPass + MLIRStandardOps MLIRTransforms LLVMCore LLVMSupport -) -target_link_libraries( + ) +add_dependencies( MLIRLoopToStandard MLIRLoopOps diff --git a/mlir/lib/Conversion/LoopsToGPU/CMakeLists.txt b/mlir/lib/Conversion/LoopsToGPU/CMakeLists.txt --- a/mlir/lib/Conversion/LoopsToGPU/CMakeLists.txt +++ b/mlir/lib/Conversion/LoopsToGPU/CMakeLists.txt @@ -4,10 +4,12 @@ MLIRGPU MLIRIR MLIRLinalgOps + MLIRLoopOps MLIRPass MLIRStandardOps MLIRSupport MLIRTransforms + MLIRTransformUtils LLVMSupport ) @@ -17,6 +19,8 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/LoopsToGPU -) + + LINK_LIBS + ${LIBS} + ) add_dependencies(MLIRLoopsToGPU ${LIBS}) -target_link_libraries(MLIRLoopsToGPU ${LIBS}) diff --git a/mlir/lib/Conversion/StandardToLLVM/CMakeLists.txt b/mlir/lib/Conversion/StandardToLLVM/CMakeLists.txt --- a/mlir/lib/Conversion/StandardToLLVM/CMakeLists.txt +++ b/mlir/lib/Conversion/StandardToLLVM/CMakeLists.txt @@ -3,16 +3,17 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/StandardToLLVM -) -add_dependencies( - MLIRStandardToLLVM + LINK_LIBS + MLIRIR MLIRLLVMIR + MLIRPass + MLIRStandardOps MLIRTransforms LLVMCore LLVMSupport -) -target_link_libraries( + ) +add_dependencies( MLIRStandardToLLVM MLIRLLVMIR diff --git a/mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt b/mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt --- a/mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt +++ b/mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt @@ -10,17 +10,18 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/SPIRV ${MLIR_MAIN_INCLUDE_DIR}/mlir/IR - ) - -add_dependencies(MLIRStandardToSPIRVTransforms - MLIRStandardToSPIRVIncGen) -target_link_libraries(MLIRStandardToSPIRVTransforms + LINK_LIBS MLIRIR MLIRPass MLIRSPIRV MLIRSupport + MLIRTransforms MLIRTransformUtils MLIRSPIRV MLIRStandardOps + LLVMSupport ) + +add_dependencies(MLIRStandardToSPIRVTransforms + MLIRStandardToSPIRVIncGen) diff --git a/mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt b/mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt --- a/mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt +++ b/mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt @@ -3,15 +3,16 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/VectorToLLVM -) -set(LIBS + + LINK_LIBS + MLIRIR MLIRLLVMIR + MLIRPass + MLIRStandardOps MLIRStandardToLLVM MLIRVectorOps MLIRTransforms + MLIRTransformUtils LLVMCore LLVMSupport - ) - -add_dependencies(MLIRVectorToLLVM ${LIBS}) -target_link_libraries(MLIRVectorToLLVM ${LIBS}) +) diff --git a/mlir/lib/Conversion/VectorToLoops/CMakeLists.txt b/mlir/lib/Conversion/VectorToLoops/CMakeLists.txt --- a/mlir/lib/Conversion/VectorToLoops/CMakeLists.txt +++ b/mlir/lib/Conversion/VectorToLoops/CMakeLists.txt @@ -3,14 +3,17 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/VectorToLoops -) -set(LIBS + + LINK_LIBS + MLIRAffineOps MLIREDSC + MLIRIR MLIRLLVMIR + MLIRLoopOps + MLIRStandardOps MLIRTransforms + MLIRTransformUtils + MLIRVectorOps LLVMCore LLVMSupport ) - -add_dependencies(MLIRVectorToLoops ${LIBS}) -target_link_libraries(MLIRVectorToLoops ${LIBS}) diff --git a/mlir/lib/Dialect/AffineOps/CMakeLists.txt b/mlir/lib/Dialect/AffineOps/CMakeLists.txt --- a/mlir/lib/Dialect/AffineOps/CMakeLists.txt +++ b/mlir/lib/Dialect/AffineOps/CMakeLists.txt @@ -5,18 +5,18 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/AffineOps - ) -add_dependencies(MLIRAffineOps - MLIRAffineOpsIncGen + LINK_LIBS MLIREDSC MLIRIR - MLIRLoopLikeInterfaceIncGen MLIRStandardOps + LLVMSupport ) -target_link_libraries(MLIRAffineOps +add_dependencies(MLIRAffineOps + MLIRAffineOpsIncGen MLIREDSC MLIRIR + MLIRLoopLikeInterfaceIncGen MLIRStandardOps ) diff --git a/mlir/lib/Dialect/CMakeLists.txt b/mlir/lib/Dialect/CMakeLists.txt --- a/mlir/lib/Dialect/CMakeLists.txt +++ b/mlir/lib/Dialect/CMakeLists.txt @@ -22,5 +22,8 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect + + LINK_LIBS + MLIRIR + LLVMSupport ) -target_link_libraries(MLIRDialect MLIRIR) diff --git a/mlir/lib/Dialect/FxpMathOps/CMakeLists.txt b/mlir/lib/Dialect/FxpMathOps/CMakeLists.txt --- a/mlir/lib/Dialect/FxpMathOps/CMakeLists.txt +++ b/mlir/lib/Dialect/FxpMathOps/CMakeLists.txt @@ -4,14 +4,16 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/FxpMathOps - ) -target_link_libraries(MLIRFxpMathOps + LINK_LIBS MLIRQuantOps MLIRIR MLIRPass MLIRSupport MLIRStandardOps + MLIRTransforms + MLIRTransformUtils + LLVMSupport ) add_dependencies(MLIRFxpMathOps MLIRFxpMathOpsIncGen diff --git a/mlir/lib/Dialect/GPU/CMakeLists.txt b/mlir/lib/Dialect/GPU/CMakeLists.txt --- a/mlir/lib/Dialect/GPU/CMakeLists.txt +++ b/mlir/lib/Dialect/GPU/CMakeLists.txt @@ -7,23 +7,24 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/GPU -) -add_dependencies(MLIRGPU - MLIRGPUOpsIncGen + + LINK_LIBS MLIREDSC MLIRIR MLIRLLVMIR MLIRLoopOps + MLIRPass + MLIRStandardOps MLIRSupport MLIRTransformUtils - LLVMSupport) -target_link_libraries(MLIRGPU + LLVMSupport + ) +add_dependencies(MLIRGPU + MLIRGPUOpsIncGen MLIREDSC MLIRIR MLIRLLVMIR MLIRLoopOps - MLIRPass - MLIRStandardOps MLIRSupport MLIRTransformUtils LLVMSupport) diff --git a/mlir/lib/Dialect/LLVMIR/CMakeLists.txt b/mlir/lib/Dialect/LLVMIR/CMakeLists.txt --- a/mlir/lib/Dialect/LLVMIR/CMakeLists.txt +++ b/mlir/lib/Dialect/LLVMIR/CMakeLists.txt @@ -3,24 +3,42 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/LLVMIR + + LINK_LIBS + LLVMAsmParser + LLVMCore + LLVMSupport + MLIRIR + MLIRSupport ) add_dependencies(MLIRLLVMIR MLIRLLVMOpsIncGen MLIRLLVMConversionsIncGen LLVMAsmParser LLVMCore LLVMSupport) -target_link_libraries(MLIRLLVMIR LLVMAsmParser LLVMCore LLVMSupport MLIRIR) add_mlir_dialect_library(MLIRNVVMIR IR/NVVMDialect.cpp ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/LLVMIR + + LINK_LIBS + LLVMAsmParser + MLIRIR + MLIRLLVMIR + LLVMSupport + LLVMCore ) add_dependencies(MLIRNVVMIR MLIRNVVMOpsIncGen MLIRNVVMConversionsIncGen LLVMAsmParser LLVMCore LLVMSupport) -target_link_libraries(MLIRNVVMIR LLVMAsmParser MLIRIR MLIRLLVMIR LLVMSupport LLVMCore) + add_mlir_dialect_library(MLIRROCDLIR IR/ROCDLDialect.cpp ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/LLVMIR + + LINK_LIBS + LLVMAsmParser + LLVMCore + LLVMSupport + MLIRIR ) add_dependencies(MLIRROCDLIR MLIRROCDLOpsIncGen MLIRROCDLConversionsIncGen LLVMAsmParser LLVMCore LLVMSupport) -target_link_libraries(MLIRROCDLIR LLVMAsmParser LLVMCore LLVMSupport MLIRIR) diff --git a/mlir/lib/Dialect/Linalg/Analysis/CMakeLists.txt b/mlir/lib/Dialect/Linalg/Analysis/CMakeLists.txt --- a/mlir/lib/Dialect/Linalg/Analysis/CMakeLists.txt +++ b/mlir/lib/Dialect/Linalg/Analysis/CMakeLists.txt @@ -1,7 +1,8 @@ set(LIBS - + MLIRIR MLIRLinalgOps MLIRStandardOps + LLVMSupport ) @@ -12,7 +13,9 @@ ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Linalg DEPENDS intrinsics_gen + + LINK_LIBS + ${LIBS} ) add_dependencies(MLIRLinalgAnalysis ${LIBS}) -target_link_libraries(MLIRLinalgAnalysis ${LIBS}) diff --git a/mlir/lib/Dialect/Linalg/EDSC/CMakeLists.txt b/mlir/lib/Dialect/Linalg/EDSC/CMakeLists.txt --- a/mlir/lib/Dialect/Linalg/EDSC/CMakeLists.txt +++ b/mlir/lib/Dialect/Linalg/EDSC/CMakeLists.txt @@ -6,6 +6,7 @@ MLIRLinalgOps MLIRLoopOps MLIRStandardOps + LLVMSupport ) add_mlir_dialect_library(MLIRLinalgEDSC @@ -15,7 +16,9 @@ ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Linalg DEPENDS intrinsics_gen + + LINK_LIBS + ${LIBS} ) add_dependencies(MLIRLinalgEDSC ${LIBS}) -target_link_libraries(MLIRLinalgEDSC ${LIBS}) diff --git a/mlir/lib/Dialect/Linalg/IR/CMakeLists.txt b/mlir/lib/Dialect/Linalg/IR/CMakeLists.txt --- a/mlir/lib/Dialect/Linalg/IR/CMakeLists.txt +++ b/mlir/lib/Dialect/Linalg/IR/CMakeLists.txt @@ -1,7 +1,8 @@ set(LIBS - MLIRIR MLIRStandardOps + MLIRSupport + LLVMSupport ) add_mlir_dialect_library(MLIRLinalgOps @@ -12,6 +13,12 @@ ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Linalg DEPENDS intrinsics_gen + + LINK_LIBS + MLIRIR + MLIRStandardOps + MLIRSupport + LLVMSupport ) add_dependencies(MLIRLinalgOps @@ -21,4 +28,3 @@ MLIRLinalgStructuredOpsIncGen MLIRLinalgStructuredOpsInterfaceIncGen ) -target_link_libraries(MLIRLinalgOps ${LIBS}) diff --git a/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt --- a/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt +++ b/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt @@ -14,6 +14,7 @@ MLIRStandardToLLVM MLIRTransformUtils MLIRVectorOps + LLVMSupport ) add_mlir_dialect_library(MLIRLinalgTransforms @@ -27,6 +28,9 @@ ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Linalg DEPENDS intrinsics_gen + + LINK_LIBS + ${LIBS} ) add_dependencies(MLIRLinalgTransforms @@ -34,4 +38,3 @@ ${LIBS} MLIRLinalgTransformPatternsIncGen ) -target_link_libraries(MLIRLinalgTransforms ${LIBS}) diff --git a/mlir/lib/Dialect/Linalg/Utils/CMakeLists.txt b/mlir/lib/Dialect/Linalg/Utils/CMakeLists.txt --- a/mlir/lib/Dialect/Linalg/Utils/CMakeLists.txt +++ b/mlir/lib/Dialect/Linalg/Utils/CMakeLists.txt @@ -1,5 +1,5 @@ set(LIBS - + MLIRAffineOps MLIREDSC MLIRIR MLIRLinalgOps @@ -7,6 +7,7 @@ MLIRPass MLIRStandardOps MLIRTransformUtils + LLVMSupport ) add_mlir_dialect_library(MLIRLinalgUtils @@ -17,7 +18,8 @@ ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Linalg DEPENDS intrinsics_gen - ) + + LINK_LIBS + ${LIBS}) add_dependencies(MLIRLinalgUtils ${LIBS}) -target_link_libraries(MLIRLinalgUtils ${LIBS}) diff --git a/mlir/lib/Dialect/LoopOps/CMakeLists.txt b/mlir/lib/Dialect/LoopOps/CMakeLists.txt --- a/mlir/lib/Dialect/LoopOps/CMakeLists.txt +++ b/mlir/lib/Dialect/LoopOps/CMakeLists.txt @@ -5,19 +5,18 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/LoopOps - ) -add_dependencies(MLIRLoopOps + LINK_LIBS MLIREDSC - MLIRLoopLikeInterfaceIncGen - MLIRLoopOpsIncGen + MLIRIR MLIRStandardOps LLVMSupport ) -target_link_libraries(MLIRLoopOps +add_dependencies(MLIRLoopOps MLIREDSC - MLIRIR + MLIRLoopLikeInterfaceIncGen + MLIRLoopOpsIncGen MLIRStandardOps LLVMSupport ) diff --git a/mlir/lib/Dialect/OpenMP/CMakeLists.txt b/mlir/lib/Dialect/OpenMP/CMakeLists.txt --- a/mlir/lib/Dialect/OpenMP/CMakeLists.txt +++ b/mlir/lib/Dialect/OpenMP/CMakeLists.txt @@ -3,7 +3,11 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/OpenMP + + LINK_LIBS + MLIRIR + LLVMCore + LLVMSupport ) add_dependencies(MLIROpenMP MLIROpenMPOpsIncGen) -target_link_libraries(MLIROpenMP MLIRIR) diff --git a/mlir/lib/Dialect/QuantOps/CMakeLists.txt b/mlir/lib/Dialect/QuantOps/CMakeLists.txt --- a/mlir/lib/Dialect/QuantOps/CMakeLists.txt +++ b/mlir/lib/Dialect/QuantOps/CMakeLists.txt @@ -11,18 +11,18 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/QuantOps - ) -add_dependencies(MLIRQuantOps - MLIRIR - MLIRPass - MLIRQuantOpsIncGen - MLIRSupport - MLIRStandardOps) -target_link_libraries(MLIRQuantOps + LINK_LIBS MLIRIR MLIRPass MLIRSupport MLIRStandardOps MLIRTransformUtils + LLVMSupport ) +add_dependencies(MLIRQuantOps + MLIRIR + MLIRPass + MLIRQuantOpsIncGen + MLIRSupport + MLIRStandardOps) diff --git a/mlir/lib/Dialect/SDBM/CMakeLists.txt b/mlir/lib/Dialect/SDBM/CMakeLists.txt --- a/mlir/lib/Dialect/SDBM/CMakeLists.txt +++ b/mlir/lib/Dialect/SDBM/CMakeLists.txt @@ -4,6 +4,10 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/SDBM -) + + LINK_LIBS + MLIRIR + MLIRSupport + LLVMSupport + ) add_dependencies(MLIRSDBM MLIRIR) -target_link_libraries(MLIRSDBM MLIRIR) diff --git a/mlir/lib/Dialect/SPIRV/CMakeLists.txt b/mlir/lib/Dialect/SPIRV/CMakeLists.txt --- a/mlir/lib/Dialect/SPIRV/CMakeLists.txt +++ b/mlir/lib/Dialect/SPIRV/CMakeLists.txt @@ -13,6 +13,14 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/SPIRV + + LINK_LIBS + MLIRIR + MLIRParser + MLIRStandardOps + MLIRSupport + MLIRTransforms + LLVMSupport ) add_dependencies(MLIRSPIRV @@ -24,11 +32,6 @@ MLIRSPIRVOpUtilsGen MLIRSPIRVTargetAndABIIncGen) -target_link_libraries(MLIRSPIRV - MLIRIR - MLIRParser - MLIRSupport - 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 --- a/mlir/lib/Dialect/SPIRV/Serialization/CMakeLists.txt +++ b/mlir/lib/Dialect/SPIRV/Serialization/CMakeLists.txt @@ -6,13 +6,15 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/SPIRV - ) - -add_dependencies(MLIRSPIRVSerialization - MLIRSPIRVSerializationGen) -target_link_libraries(MLIRSPIRVSerialization + LINK_LIBS MLIRIR + MLIRParser MLIRSPIRV MLIRSupport - MLIRTranslation) + MLIRTranslation + LLVMSupport + ) + +add_dependencies(MLIRSPIRVSerialization + MLIRSPIRVSerializationGen) diff --git a/mlir/lib/Dialect/SPIRV/Transforms/CMakeLists.txt b/mlir/lib/Dialect/SPIRV/Transforms/CMakeLists.txt --- a/mlir/lib/Dialect/SPIRV/Transforms/CMakeLists.txt +++ b/mlir/lib/Dialect/SPIRV/Transforms/CMakeLists.txt @@ -4,9 +4,13 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/SPIRV - ) -target_link_libraries(MLIRSPIRVTransforms + LINK_LIBS + MLIRIR MLIRPass MLIRSPIRV + MLIRStandardOps + MLIRTransforms + MLIRTransformUtils + LLVMSupport ) diff --git a/mlir/lib/Dialect/StandardOps/CMakeLists.txt b/mlir/lib/Dialect/StandardOps/CMakeLists.txt --- a/mlir/lib/Dialect/StandardOps/CMakeLists.txt +++ b/mlir/lib/Dialect/StandardOps/CMakeLists.txt @@ -5,18 +5,19 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/StandardOps - ) -add_dependencies(MLIRStandardOps - MLIRCallOpInterfacesIncGen + LINK_LIBS MLIREDSC MLIRIR - MLIRStandardOpsIncGen + MLIRSupport + LLVMCore LLVMSupport ) -target_link_libraries(MLIRStandardOps +add_dependencies(MLIRStandardOps + MLIRCallOpInterfacesIncGen MLIREDSC MLIRIR + MLIRStandardOpsIncGen LLVMSupport ) diff --git a/mlir/lib/Dialect/VectorOps/CMakeLists.txt b/mlir/lib/Dialect/VectorOps/CMakeLists.txt --- a/mlir/lib/Dialect/VectorOps/CMakeLists.txt +++ b/mlir/lib/Dialect/VectorOps/CMakeLists.txt @@ -6,9 +6,15 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/VectorOps + + LINK_LIBS + MLIRIR + MLIRStandardOps + MLIRAffineOps + MLIRLoopOps + MLIRLoopAnalysis + LLVMSupport ) add_dependencies(MLIRVectorOps MLIRVectorOpsIncGen) add_dependencies(MLIRVectorOps MLIRVectorTransformPatternsIncGen) - -target_link_libraries(MLIRVectorOps MLIRIR MLIRStandardOps MLIRAffineOps MLIRLoopOps MLIRLoopAnalysis) diff --git a/mlir/lib/EDSC/CMakeLists.txt b/mlir/lib/EDSC/CMakeLists.txt --- a/mlir/lib/EDSC/CMakeLists.txt +++ b/mlir/lib/EDSC/CMakeLists.txt @@ -8,12 +8,11 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/EDSC - ) -target_link_libraries(MLIREDSC - PUBLIC + LINK_LIBS MLIRIR MLIRSupport + LLVMSupport ) add_llvm_library(MLIREDSCInterface @@ -21,11 +20,11 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/EDSC - ) -add_dependencies(MLIREDSCInterface MLIRIR) -target_link_libraries(MLIREDSCInterface - PUBLIC + + LINK_LIBS MLIRIR MLIRSupport MLIRParser + LLVMSupport ) +add_dependencies(MLIREDSCInterface MLIRIR) diff --git a/mlir/lib/ExecutionEngine/CMakeLists.txt b/mlir/lib/ExecutionEngine/CMakeLists.txt --- a/mlir/lib/ExecutionEngine/CMakeLists.txt +++ b/mlir/lib/ExecutionEngine/CMakeLists.txt @@ -12,13 +12,15 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/ExecutionEngine - ) -target_link_libraries(MLIRExecutionEngine + LINK_LIBS + MLIRIR MLIRLLVMIR + MLIRSupport MLIRTargetLLVMIR LLVMBitReader LLVMBitWriter + LLVMCore LLVMExecutionEngine LLVMObject LLVMOrcJIT @@ -32,8 +34,8 @@ LLVMTarget LLVMVectorize LLVMTransformUtils - - ${outlibs}) + ${outlibs} + ) add_llvm_library(mlir_c_runner_utils SHARED CRunnerUtils.cpp) target_compile_definitions(mlir_c_runner_utils PRIVATE mlir_c_runner_utils_EXPORTS) diff --git a/mlir/lib/IR/CMakeLists.txt b/mlir/lib/IR/CMakeLists.txt --- a/mlir/lib/IR/CMakeLists.txt +++ b/mlir/lib/IR/CMakeLists.txt @@ -4,6 +4,10 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/IR + + LINK_LIBS + MLIRSupport + LLVMSupport + ${LLVM_PTHREAD_LIB} ) add_dependencies(MLIRIR MLIRCallOpInterfacesIncGen MLIROpAsmInterfacesIncGen MLIRSupport LLVMSupport) -target_link_libraries(MLIRIR MLIRSupport LLVMSupport) diff --git a/mlir/lib/Parser/CMakeLists.txt b/mlir/lib/Parser/CMakeLists.txt --- a/mlir/lib/Parser/CMakeLists.txt +++ b/mlir/lib/Parser/CMakeLists.txt @@ -5,6 +5,10 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Parser + + LINK_LIBS + MLIRIR + MLIRAnalysis + LLVMSupport ) add_dependencies(MLIRParser MLIRIR MLIRAnalysis) -target_link_libraries(MLIRParser MLIRIR MLIRAnalysis) diff --git a/mlir/lib/Pass/CMakeLists.txt b/mlir/lib/Pass/CMakeLists.txt --- a/mlir/lib/Pass/CMakeLists.txt +++ b/mlir/lib/Pass/CMakeLists.txt @@ -4,6 +4,12 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Pass + + LINK_LIBS + MLIRAnalysis + MLIRIR + MLIRSupport + LLVMIRReader + LLVMSupport ) add_dependencies(MLIRPass MLIRAnalysis MLIRIR LLVMSupport) -target_link_libraries(MLIRPass MLIRAnalysis MLIRIR LLVMSupport) diff --git a/mlir/lib/Quantizer/CMakeLists.txt b/mlir/lib/Quantizer/CMakeLists.txt --- a/mlir/lib/Quantizer/CMakeLists.txt +++ b/mlir/lib/Quantizer/CMakeLists.txt @@ -9,14 +9,8 @@ Support/UniformSolvers.cpp ADDITIONAL_HEADER_DIRS - ) -add_dependencies(MLIRQuantizerSupport - MLIRIR - MLIRQuantOps - MLIRSupport - MLIRStandardOps) -target_link_libraries(MLIRQuantizerSupport + LINK_LIBS MLIRIR MLIRQuantOps MLIRSupport @@ -24,23 +18,32 @@ LLVMSupport ) +add_dependencies(MLIRQuantizerSupport + MLIRIR + MLIRQuantOps + MLIRSupport + MLIRStandardOps) + # Configurations. add_llvm_library(MLIRQuantizerFxpMathConfig Configurations/FxpMathConfig.cpp ADDITIONAL_HEADER_DIRS - ) -add_dependencies(MLIRQuantizerFxpMathConfig - MLIRFxpMathOpsIncGen - MLIRQuantizerSupport) -target_link_libraries(MLIRQuantizerFxpMathConfig + LINK_LIBS MLIRIR MLIRFxpMathOps MLIRQuantOps MLIRQuantizerSupport + MLIRStandardOps + MLIRSupport + LLVMSupport ) +add_dependencies(MLIRQuantizerFxpMathConfig + MLIRFxpMathOpsIncGen + MLIRQuantizerSupport) + # Transforms. add_llvm_library(MLIRQuantizerTransforms Transforms/AddDefaultStatsTestPass.cpp @@ -48,16 +51,18 @@ Transforms/RemoveInstrumentationPass.cpp ADDITIONAL_HEADER_DIRS - ) -add_dependencies(MLIRQuantizerTransforms - MLIRQuantizerFxpMathConfig - MLIRQuantizerSupport - MLIRPass) -target_link_libraries(MLIRQuantizerTransforms + + LINK_LIBS MLIRIR MLIRQuantizerFxpMathConfig MLIRQuantizerSupport MLIRQuantOps MLIRPass + MLIRTransforms + MLIRTransformUtils LLVMSupport ) +add_dependencies(MLIRQuantizerTransforms + MLIRQuantizerFxpMathConfig + MLIRQuantizerSupport + MLIRPass) diff --git a/mlir/lib/Support/CMakeLists.txt b/mlir/lib/Support/CMakeLists.txt --- a/mlir/lib/Support/CMakeLists.txt +++ b/mlir/lib/Support/CMakeLists.txt @@ -14,20 +14,24 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Support + + LINK_LIBS + LLVMSupport + ${LLVM_PTHREAD_LIB} ) -target_link_libraries(MLIRSupport LLVMSupport ${LLVM_PTHREAD_LIB}) add_llvm_library(MLIROptLib MlirOptMain.cpp ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Support - ) -target_link_libraries(MLIROptLib + + LINK_LIBS + MLIRIR MLIRPass MLIRParser - LLVMSupport MLIRSupport + LLVMSupport ) add_llvm_library(MLIRTranslateClParser @@ -35,15 +39,22 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Support + + LINK_LIBS + LLVMSupport + MLIRAnalysis + MLIRIR + MLIRTranslation + MLIRParser ) -target_link_libraries(MLIRTranslateClParser LLVMSupport MLIRIR MLIRTranslation MLIRParser) add_llvm_library(MLIRJitRunner JitRunner.cpp -) -target_link_libraries(MLIRJitRunner PRIVATE + + LINK_LIBS MLIRExecutionEngine MLIRIR + MLIRLLVMIR MLIRParser MLIRStandardOps MLIRTargetLLVMIR @@ -51,5 +62,9 @@ MLIRStandardToLLVM MLIRSupport LLVMCore + LLVMOrcJIT LLVMSupport -) + LLVMX86CodeGen + LLVMX86Desc + LLVMX86Info + ) diff --git a/mlir/lib/TableGen/CMakeLists.txt b/mlir/lib/TableGen/CMakeLists.txt --- a/mlir/lib/TableGen/CMakeLists.txt +++ b/mlir/lib/TableGen/CMakeLists.txt @@ -15,5 +15,8 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/TableGen + + LINK_LIBS + LLVMSupport + LLVMTableGen ) -target_link_libraries(LLVMMLIRTableGen LLVMSupport LLVMTableGen) diff --git a/mlir/lib/Target/CMakeLists.txt b/mlir/lib/Target/CMakeLists.txt --- a/mlir/lib/Target/CMakeLists.txt +++ b/mlir/lib/Target/CMakeLists.txt @@ -4,47 +4,74 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Target/LLVMIR + DEPENDS intrinsics_gen + + LINK_LIBS + MLIRLLVMIR + LLVMCore + LLVMIRReader + LLVMSupport + LLVMTransformUtils + MLIRIR + MLIRSupport + MLIRTranslation ) -target_link_libraries(MLIRTargetLLVMIRModuleTranslation - MLIRLLVMIR LLVMCore LLVMIRReader LLVMSupport LLVMTransformUtils - MLIRTranslation) + add_llvm_library(MLIRTargetLLVMIR LLVMIR/ConvertFromLLVMIR.cpp LLVMIR/ConvertToLLVMIR.cpp ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Target/LLVMIR + + LINK_LIBS + MLIRIR + MLIRLLVMIR + MLIRSupport + MLIRTargetLLVMIRModuleTranslation + MLIRTranslation + LLVMCore + LLVMIRReader + LLVMSupport ) -target_link_libraries(MLIRTargetLLVMIR MLIRTargetLLVMIRModuleTranslation) add_llvm_library(MLIRTargetNVVMIR LLVMIR/ConvertToNVVMIR.cpp ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Target/LLVMIR + DEPENDS intrinsics_gen - ) -target_link_libraries(MLIRTargetNVVMIR + + LINK_LIBS MLIRGPU MLIRIR MLIRLLVMIR MLIRNVVMIR MLIRTargetLLVMIRModuleTranslation + MLIRTranslation + LLVMCore + LLVMSupport ) + add_llvm_library(MLIRTargetROCDLIR LLVMIR/ConvertToROCDLIR.cpp ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Target/LLVMIR + DEPENDS intrinsics_gen - ) -target_link_libraries(MLIRTargetROCDLIR + + LINK_LIBS MLIRGPU MLIRIR MLIRLLVMIR MLIRROCDLIR MLIRTargetLLVMIRModuleTranslation + MLIRTranslation + LLVMCore + LLVMSupport ) diff --git a/mlir/lib/Transforms/CMakeLists.txt b/mlir/lib/Transforms/CMakeLists.txt --- a/mlir/lib/Transforms/CMakeLists.txt +++ b/mlir/lib/Transforms/CMakeLists.txt @@ -26,16 +26,21 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Transforms - ) -add_dependencies(MLIRTransforms - MLIRLoopLikeInterfaceIncGen - MLIRStandardOpsIncGen) -target_link_libraries(MLIRTransforms + LINK_LIBS MLIRAffineOps MLIRAnalysis + MLIRIR MLIRLoopOps + MLIRLoopAnalysis MLIRPass + MLIRSupport + MLIRStandardOps MLIRTransformUtils MLIRVectorOps + LLVMSupport ) + +add_dependencies(MLIRTransforms + MLIRLoopLikeInterfaceIncGen + MLIRStandardOpsIncGen) diff --git a/mlir/lib/Transforms/Utils/CMakeLists.txt b/mlir/lib/Transforms/Utils/CMakeLists.txt --- a/mlir/lib/Transforms/Utils/CMakeLists.txt +++ b/mlir/lib/Transforms/Utils/CMakeLists.txt @@ -9,14 +9,15 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Transforms - ) -add_dependencies(MLIRTransformUtils MLIRStandardOpsIncGen) -target_link_libraries(MLIRTransformUtils + LINK_LIBS MLIRAffineOps MLIRAnalysis + MLIRIR MLIRLoopAnalysis MLIRLoopOps MLIRPass MLIRStandardOps + LLVMSupport ) +add_dependencies(MLIRTransformUtils MLIRStandardOpsIncGen) diff --git a/mlir/lib/Translation/CMakeLists.txt b/mlir/lib/Translation/CMakeLists.txt --- a/mlir/lib/Translation/CMakeLists.txt +++ b/mlir/lib/Translation/CMakeLists.txt @@ -3,5 +3,7 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Translation - ) -target_link_libraries(MLIRTranslation LLVMSupport) + + LINK_LIBS + LLVMSupport +) diff --git a/mlir/test/EDSC/CMakeLists.txt b/mlir/test/EDSC/CMakeLists.txt --- a/mlir/test/EDSC/CMakeLists.txt +++ b/mlir/test/EDSC/CMakeLists.txt @@ -15,6 +15,7 @@ MLIRStandardOps MLIRTransforms MLIRVectorOps + MLIRTransformUtils LLVMCore LLVMSupport ) diff --git a/mlir/test/lib/Dialect/SPIRV/CMakeLists.txt b/mlir/test/lib/Dialect/SPIRV/CMakeLists.txt --- a/mlir/test/lib/Dialect/SPIRV/CMakeLists.txt +++ b/mlir/test/lib/Dialect/SPIRV/CMakeLists.txt @@ -4,11 +4,13 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/SPIRV ${MLIR_MAIN_INCLUDE_DIR}/mlir/IR - ) -target_link_libraries(MLIRSPIRVTestPasses PRIVATE + LINK_LIBS MLIRIR MLIRPass MLIRSPIRV MLIRSupport + MLIRTransforms + MLIRTransformUtils + LLVMSupport ) diff --git a/mlir/test/lib/IR/CMakeLists.txt b/mlir/test/lib/IR/CMakeLists.txt --- a/mlir/test/lib/IR/CMakeLists.txt +++ b/mlir/test/lib/IR/CMakeLists.txt @@ -4,12 +4,15 @@ TestSymbolUses.cpp ADDITIONAL_HEADER_DIRS + + LINK_LIBS + MLIRIR + MLIRPass + MLIRStandardOps + LLVMSupport ) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../TestDialect) include_directories(${CMAKE_CURRENT_BINARY_DIR}/../TestDialect) add_dependencies(MLIRTestIR MLIRTestDialect ) -target_link_libraries(MLIRTestIR - MLIRPass - ) diff --git a/mlir/test/lib/Pass/CMakeLists.txt b/mlir/test/lib/Pass/CMakeLists.txt --- a/mlir/test/lib/Pass/CMakeLists.txt +++ b/mlir/test/lib/Pass/CMakeLists.txt @@ -3,8 +3,9 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Pass - ) -target_link_libraries(MLIRTestPass + + LINK_LIBS MLIRIR MLIRPass + LLVMSupport ) diff --git a/mlir/test/lib/TestDialect/CMakeLists.txt b/mlir/test/lib/TestDialect/CMakeLists.txt --- a/mlir/test/lib/TestDialect/CMakeLists.txt +++ b/mlir/test/lib/TestDialect/CMakeLists.txt @@ -14,12 +14,9 @@ add_llvm_library(MLIRTestDialect TestDialect.cpp TestPatterns.cpp -) -add_dependencies(MLIRTestDialect - MLIRTestOpsIncGen - MLIRTypeInferOpInterfaceIncGen -) -target_link_libraries(MLIRTestDialect + + LINK_LIBS + MLIRAnalysis MLIRDialect MLIRIR MLIRLinalgTransforms @@ -28,3 +25,7 @@ MLIRTransformUtils LLVMSupport ) +add_dependencies(MLIRTestDialect + MLIRTestOpsIncGen + MLIRTypeInferOpInterfaceIncGen +) diff --git a/mlir/test/lib/Transforms/CMakeLists.txt b/mlir/test/lib/Transforms/CMakeLists.txt --- a/mlir/test/lib/Transforms/CMakeLists.txt +++ b/mlir/test/lib/Transforms/CMakeLists.txt @@ -22,27 +22,31 @@ ADDITIONAL_HEADER_DIRS ${MLIR_MAIN_INCLUDE_DIR}/mlir/Transforms -) -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 + LINK_LIBS MLIRAffineOps MLIRAnalysis + MLIRLoopAnalysis MLIREDSC MLIRGPU + MLIRIR MLIRLinalgOps MLIRLinalgTransforms MLIRLoopOps MLIRGPU MLIRPass + MLIRStandardOps MLIRTestDialect MLIRTransformUtils MLIRVectorToLoops MLIRVectorOps - ) + LLVMSupport +) + +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) diff --git a/mlir/test/mlir-cpu-runner/CMakeLists.txt b/mlir/test/mlir-cpu-runner/CMakeLists.txt --- a/mlir/test/mlir-cpu-runner/CMakeLists.txt +++ b/mlir/test/mlir-cpu-runner/CMakeLists.txt @@ -6,7 +6,9 @@ add_llvm_library(cblas SHARED cblas.cpp) target_compile_definitions(cblas PRIVATE cblas_EXPORTS) -add_llvm_library(cblas_interface SHARED cblas_interface.cpp) -target_link_libraries(cblas_interface PRIVATE cblas) +add_llvm_library(cblas_interface SHARED cblas_interface.cpp + LINK_LIBS + cblas + ) target_compile_definitions(cblas_interface PRIVATE cblas_interface_EXPORTS) diff --git a/mlir/tools/mlir-cuda-runner/CMakeLists.txt b/mlir/tools/mlir-cuda-runner/CMakeLists.txt --- a/mlir/tools/mlir-cuda-runner/CMakeLists.txt +++ b/mlir/tools/mlir-cuda-runner/CMakeLists.txt @@ -25,15 +25,15 @@ add_llvm_library(cuda-runtime-wrappers SHARED cuda-runtime-wrappers.cpp + + LINK_LIBS + LLVMSupport + ${CUDA_RUNTIME_LIBRARY} ) target_include_directories(cuda-runtime-wrappers PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES} LLVMSupport ) - target_link_libraries(cuda-runtime-wrappers - LLVMSupport - ${CUDA_RUNTIME_LIBRARY} - ) get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS) get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS) diff --git a/mlir/tools/mlir-opt/CMakeLists.txt b/mlir/tools/mlir-opt/CMakeLists.txt --- a/mlir/tools/mlir-opt/CMakeLists.txt +++ b/mlir/tools/mlir-opt/CMakeLists.txt @@ -10,11 +10,12 @@ MLIRPass MLIRTransforms MLIRSupport -) + LLVMSupport + ) add_llvm_library(MLIRMlirOptMain mlir-opt.cpp -) -target_link_libraries(MLIRMlirOptMain + + LINK_LIBS ${LIB_LIBS} ) diff --git a/mlir/unittests/Dialect/SPIRV/CMakeLists.txt b/mlir/unittests/Dialect/SPIRV/CMakeLists.txt --- a/mlir/unittests/Dialect/SPIRV/CMakeLists.txt +++ b/mlir/unittests/Dialect/SPIRV/CMakeLists.txt @@ -4,8 +4,11 @@ ) target_link_libraries(MLIRSPIRVTests PRIVATE + MLIRIR MLIRSPIRV - MLIRSPIRVSerialization) + MLIRSPIRVSerialization + MLIRStandardOps + MLIRSupport) whole_archive_link(MLIRSPIRVTests MLIRSPIRV) diff --git a/mlir/unittests/Pass/CMakeLists.txt b/mlir/unittests/Pass/CMakeLists.txt --- a/mlir/unittests/Pass/CMakeLists.txt +++ b/mlir/unittests/Pass/CMakeLists.txt @@ -3,4 +3,7 @@ ) target_link_libraries(MLIRPassTests PRIVATE - MLIRPass) + MLIRIR + MLIRPass + MLIRStandardOps + MLIRSupport) diff --git a/mlir/unittests/SDBM/CMakeLists.txt b/mlir/unittests/SDBM/CMakeLists.txt --- a/mlir/unittests/SDBM/CMakeLists.txt +++ b/mlir/unittests/SDBM/CMakeLists.txt @@ -3,6 +3,9 @@ ) target_link_libraries(MLIRSDBMTests PRIVATE + MLIRIR MLIRSDBM -) + MLIRStandardOps + MLIRSupport + ) whole_archive_link(MLIRSDBMTests MLIRSDBM)