5 changes: 1 addition & 4 deletions mlir/lib/Conversion/GPUToVulkan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ add_mlir_conversion_library(MLIRGPUtoVulkanTransforms

DEPENDS
MLIRConversionPassIncGen
)

target_link_libraries(MLIRGPUtoVulkanTransforms
PUBLIC
LINK_LIBS PUBLIC
MLIRGPU
MLIRIR
MLIRLLVMIR
Expand All @@ -18,5 +16,4 @@ target_link_libraries(MLIRGPUtoVulkanTransforms
MLIRSupport
MLIRTransforms
MLIRTranslation
LLVMSupport
)
10 changes: 5 additions & 5 deletions mlir/lib/Conversion/LinalgToLLVM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ add_mlir_conversion_library(MLIRLinalgToLLVM

DEPENDS
MLIRConversionPassIncGen
)
intrinsics_gen

target_link_libraries(MLIRLinalgToLLVM
PUBLIC
LINK_COMPONENTS
Core

LINK_LIBS PUBLIC
MLIRAffineToStandard
MLIREDSC
MLIRIR
Expand All @@ -20,6 +22,4 @@ target_link_libraries(MLIRLinalgToLLVM
MLIRVectorToLLVM
MLIRVectorToLoops
MLIRTransforms
LLVMCore
LLVMSupport
)
4 changes: 1 addition & 3 deletions mlir/lib/Conversion/LinalgToSPIRV/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ add_mlir_conversion_library(MLIRLinalgToSPIRVTransforms

DEPENDS
MLIRConversionPassIncGen
)

target_link_libraries(MLIRLinalgToSPIRVTransforms
PUBLIC
LINK_LIBS PUBLIC
MLIRIR
MLIRLinalgOps
MLIRLinalgUtils
Expand Down
11 changes: 5 additions & 6 deletions mlir/lib/Conversion/LoopToStandard/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ add_mlir_conversion_library(MLIRLoopToStandard

DEPENDS
MLIRConversionPassIncGen
)
target_link_libraries(
MLIRLoopToStandard
PUBLIC

LINK_COMPONENTS
Core

LINK_LIBS PUBLIC
MLIRLoopOps
MLIRTransforms
LLVMCore
LLVMSupport
)
6 changes: 2 additions & 4 deletions mlir/lib/Conversion/LoopsToGPU/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ add_mlir_conversion_library(MLIRLoopsToGPU

DEPENDS
MLIRConversionPassIncGen
)
target_link_libraries(MLIRLoopsToGPU
PUBLIC

LINK_LIBS PUBLIC
MLIRAffineOps
MLIRAffineToStandard
MLIRGPU
Expand All @@ -19,5 +18,4 @@ target_link_libraries(MLIRLoopsToGPU
MLIRStandardOps
MLIRSupport
MLIRTransforms
LLVMSupport
)
12 changes: 6 additions & 6 deletions mlir/lib/Conversion/StandardToLLVM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ add_mlir_conversion_library(MLIRStandardToLLVM

DEPENDS
MLIRConversionPassIncGen
)
target_link_libraries(
MLIRStandardToLLVM
PUBLIC
intrinsics_gen

LINK_COMPONENTS
Core

LINK_LIBS PUBLIC
MLIRLLVMIR
MLIRTransforms
LLVMCore
LLVMSupport
)
4 changes: 1 addition & 3 deletions mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ add_mlir_conversion_library(MLIRStandardToSPIRVTransforms

DEPENDS
MLIRConversionPassIncGen
)

target_link_libraries(MLIRStandardToSPIRVTransforms
PUBLIC
LINK_LIBS PUBLIC
MLIRIR
MLIRPass
MLIRSPIRV
Expand Down
5 changes: 2 additions & 3 deletions mlir/lib/Conversion/StandardToStandard/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ add_mlir_conversion_library(MLIRStandardToStandard

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/StandardToStandard
)
target_link_libraries(MLIRStandardToStandard
PUBLIC

LINK_LIBS PUBLIC
MLIRIR
MLIRPass
MLIRStandardOps
Expand Down
10 changes: 5 additions & 5 deletions mlir/lib/Conversion/VectorToLLVM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ add_mlir_conversion_library(MLIRVectorToLLVM

DEPENDS
MLIRConversionPassIncGen
)
intrinsics_gen

target_link_libraries(MLIRVectorToLLVM
PUBLIC
LINK_COMPONENTS
Core

LINK_LIBS PUBLIC
MLIRLLVMIR
MLIRStandardToLLVM
MLIRVector
MLIRTransforms
LLVMCore
LLVMSupport
)
9 changes: 4 additions & 5 deletions mlir/lib/Conversion/VectorToLoops/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ add_mlir_conversion_library(MLIRVectorToLoops

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/VectorToLoops
)

target_link_libraries(MLIRVectorToLoops
PUBLIC
LINK_COMPONENTS
Core

LINK_LIBS PUBLIC
MLIREDSC
MLIRAffineEDSC
MLIRLLVMIR
MLIRTransforms
LLVMCore
LLVMSupport
)
6 changes: 2 additions & 4 deletions mlir/lib/Dialect/AVX512/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ add_mlir_dialect_library(MLIRAVX512

DEPENDS
MLIRAVX512IncGen
)
target_link_libraries(MLIRAVX512
PUBLIC

LINK_LIBS PUBLIC
MLIRIR
MLIRSideEffects
MLIRVectorToLLVM
LLVMSupport
)
5 changes: 2 additions & 3 deletions mlir/lib/Dialect/Affine/EDSC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ add_mlir_dialect_library(MLIRAffineEDSC

DEPENDS
MLIRAffineOpsIncGen
)
target_link_libraries(MLIRAffineEDSC
PUBLIC

LINK_LIBS PUBLIC
MLIRAffineOps
MLIREDSC
MLIRIR
Expand Down
5 changes: 2 additions & 3 deletions mlir/lib/Dialect/Affine/IR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ add_mlir_dialect_library(MLIRAffineOps

DEPENDS
MLIRAffineOpsIncGen
)
target_link_libraries(MLIRAffineOps
PUBLIC

LINK_LIBS PUBLIC
MLIREDSC
MLIRIR
MLIRLoopLikeInterface
Expand Down
5 changes: 2 additions & 3 deletions mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ add_mlir_dialect_library(MLIRAffineTransforms
MLIRAffineOpsIncGen
MLIRAffinePassIncGen
MLIRLoopLikeInterfaceIncGen
)
target_link_libraries(MLIRAffineTransforms
PUBLIC

LINK_LIBS PUBLIC
MLIRAffineOps
MLIREDSC
MLIRIR
Expand Down
4 changes: 1 addition & 3 deletions mlir/lib/Dialect/Affine/Utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ add_mlir_dialect_library(MLIRAffineUtils
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Affine

)
target_link_libraries(MLIRAffineUtils
PUBLIC
LINK_LIBS PUBLIC
MLIRAffineOps
MLIRTransformUtils
)
5 changes: 2 additions & 3 deletions mlir/lib/Dialect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ add_mlir_library(MLIRDialect

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect
)
target_link_libraries(MLIRDialect
PUBLIC

LINK_LIBS PUBLIC
MLIRIR
)
6 changes: 2 additions & 4 deletions mlir/lib/Dialect/GPU/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ add_mlir_dialect_library(MLIRGPU
MLIRGPUPassIncGen
MLIRParallelLoopMapperAttrGen
MLIRParallelLoopMapperEnumsGen
)
target_link_libraries(MLIRGPU
PUBLIC

LINK_LIBS PUBLIC
MLIREDSC
MLIRIR
MLIRLLVMIR
Expand All @@ -25,5 +24,4 @@ target_link_libraries(MLIRGPU
MLIRStandardOps
MLIRSupport
MLIRTransformUtils
LLVMSupport
)
58 changes: 31 additions & 27 deletions mlir/lib/Dialect/LLVMIR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ add_mlir_dialect_library(MLIRLLVMIR
DEPENDS
MLIRLLVMOpsIncGen
MLIRLLVMConversionsIncGen
)
target_link_libraries(MLIRLLVMIR
PUBLIC
LLVMAsmParser
LLVMBitReader
LLVMBitWriter
LLVMCore
LLVMSupport
LLVMFrontendOpenMP
intrinsics_gen

LINK_COMPONENTS
AsmParser
BitReader
BitWriter
Core
FrontendOpenMP

LINK_LIBS PUBLIC
MLIRCallInterfaces
MLIRControlFlowInterfaces
MLIROpenMP
Expand All @@ -35,15 +36,16 @@ add_mlir_dialect_library(MLIRLLVMAVX512
DEPENDS
MLIRLLVMAVX512IncGen
MLIRLLVMAVX512ConversionsIncGen
)
target_link_libraries(MLIRLLVMAVX512
PUBLIC
LLVMAsmParser
intrinsics_gen

LINK_COMPONENTS
AsmParser
Core

LINK_LIBS PUBLIC
MLIRIR
MLIRLLVMIR
MLIRSideEffects
LLVMSupport
LLVMCore
)

add_mlir_dialect_library(MLIRNVVMIR
Expand All @@ -55,15 +57,16 @@ add_mlir_dialect_library(MLIRNVVMIR
DEPENDS
MLIRNVVMOpsIncGen
MLIRNVVMConversionsIncGen
)
target_link_libraries(MLIRNVVMIR
PUBLIC
LLVMAsmParser
intrinsics_gen

LINK_COMPONENTS
AsmParser
Core

LINK_LIBS PUBLIC
MLIRIR
MLIRLLVMIR
MLIRSideEffects
LLVMSupport
LLVMCore
)

add_mlir_dialect_library(MLIRROCDLIR
Expand All @@ -75,12 +78,13 @@ add_mlir_dialect_library(MLIRROCDLIR
DEPENDS
MLIRROCDLOpsIncGen
MLIRROCDLConversionsIncGen
)
target_link_libraries(MLIRROCDLIR
PUBLIC
LLVMAsmParser
LLVMCore
LLVMSupport
intrinsics_gen

LINK_COMPONENTS
AsmParser
Core

LINK_LIBS PUBLIC
MLIRIR
MLIRSideEffects
MLIRVectorToLLVM
Expand Down
4 changes: 1 addition & 3 deletions mlir/lib/Dialect/LLVMIR/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ add_mlir_dialect_library(MLIRLLVMIRTransforms

DEPENDS
MLIRLLVMPassIncGen
)

target_link_libraries(MLIRLLVMIRTransforms
PUBLIC
LINK_LIBS PUBLIC
MLIRIR
MLIRLLVMIR
MLIRPass
Expand Down
8 changes: 1 addition & 7 deletions mlir/lib/Dialect/Linalg/Analysis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,8 @@ add_mlir_dialect_library(MLIRLinalgAnalysis
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Linalg

DEPENDS
intrinsics_gen
)

target_link_libraries(MLIRLinalgAnalysis
PUBLIC
LINK_LIBS PUBLIC
MLIRIR
MLIRLinalgOps
MLIRStandardOps
LLVMSupport
)
8 changes: 1 addition & 7 deletions mlir/lib/Dialect/Linalg/EDSC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,12 @@ add_mlir_dialect_library(MLIRLinalgEDSC
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Linalg

DEPENDS
intrinsics_gen
)

target_link_libraries(MLIRLinalgEDSC
PUBLIC
LINK_LIBS PUBLIC
MLIREDSC
MLIRIR
MLIRAffineOps
MLIRAffineEDSC
MLIRLinalgOps
MLIRLoopOps
MLIRStandardOps
LLVMSupport
)
6 changes: 2 additions & 4 deletions mlir/lib/Dialect/Linalg/IR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ add_mlir_dialect_library(MLIRLinalgOps
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Linalg

DEPENDS
intrinsics_gen
MLIRLinalgOpsIncGen
MLIRLinalgStructuredOpsIncGen
MLIRLinalgStructuredOpsInterfaceIncGen
)
target_link_libraries(MLIRLinalgOps
PUBLIC

LINK_LIBS PUBLIC
MLIRIR
MLIRSideEffects
MLIRViewLikeInterface
Expand Down
6 changes: 2 additions & 4 deletions mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ add_mlir_dialect_library(MLIRLinalgTransforms
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Linalg

DEPENDS
intrinsics_gen
MLIRLinalgPassIncGen
)
target_link_libraries(MLIRLinalgTransforms
PUBLIC

LINK_LIBS PUBLIC
MLIRAffineOps
MLIRAnalysis
MLIREDSC
Expand Down
6 changes: 1 addition & 5 deletions mlir/lib/Dialect/Linalg/Utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@ add_mlir_dialect_library(MLIRLinalgUtils

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Linalg
DEPENDS
intrinsics_gen
)

target_link_libraries(MLIRLinalgUtils
PUBLIC
LINK_LIBS PUBLIC
MLIRAffineOps
MLIREDSC
MLIRIR
Expand Down
6 changes: 2 additions & 4 deletions mlir/lib/Dialect/LoopOps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ add_mlir_dialect_library(MLIRLoopOps

DEPENDS
MLIRLoopOpsIncGen
)
target_link_libraries(MLIRLoopOps
PUBLIC

LINK_LIBS PUBLIC
MLIREDSC
MLIRIR
MLIRLoopLikeInterface
MLIRSideEffects
MLIRStandardOps
LLVMSupport
)

add_subdirectory(Transforms)
6 changes: 2 additions & 4 deletions mlir/lib/Dialect/LoopOps/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ add_mlir_dialect_library(MLIRLoopOpsTransforms

DEPENDS
MLIRLoopPassIncGen
)
target_link_libraries(MLIRLoopOpsTransforms
PUBLIC

LINK_LIBS PUBLIC
MLIRAffineOps
MLIRIR
MLIRPass
MLIRLoopOps
MLIRStandardOps
MLIRSupport
LLVMSupport
)
5 changes: 2 additions & 3 deletions mlir/lib/Dialect/OpenMP/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ add_mlir_dialect_library(MLIROpenMP

DEPENDS
MLIROpenMPOpsIncGen
)
target_link_libraries(MLIROpenMP
PUBLIC

LINK_LIBS PUBLIC
MLIRIR
)
5 changes: 2 additions & 3 deletions mlir/lib/Dialect/Quant/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ add_mlir_dialect_library(MLIRQuant
DEPENDS
MLIRQuantOpsIncGen
MLIRQuantPassIncGen
)
target_link_libraries(MLIRQuant
PUBLIC

LINK_LIBS PUBLIC
MLIRIR
MLIRPass
MLIRSideEffects
Expand Down
5 changes: 2 additions & 3 deletions mlir/lib/Dialect/SDBM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ add_mlir_dialect_library(MLIRSDBM

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/SDBM
)
target_link_libraries(MLIRSDBM
PUBLIC

LINK_LIBS PUBLIC
MLIRIR
)
5 changes: 2 additions & 3 deletions mlir/lib/Dialect/SPIRV/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ add_mlir_dialect_library(MLIRSPIRV
MLIRSPIRVOpsIncGen
MLIRSPIRVOpUtilsGen
MLIRSPIRVTargetAndABIIncGen
)
target_link_libraries(MLIRSPIRV
PUBLIC

LINK_LIBS PUBLIC
MLIRControlFlowInterfaces
MLIRIR
MLIRParser
Expand Down
5 changes: 2 additions & 3 deletions mlir/lib/Dialect/SPIRV/Serialization/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ add_mlir_dialect_library(MLIRSPIRVSerialization

DEPENDS
MLIRSPIRVSerializationGen
)
target_link_libraries(MLIRSPIRVSerialization
PUBLIC

LINK_LIBS PUBLIC
MLIRIR
MLIRSPIRV
MLIRSupport
Expand Down
4 changes: 1 addition & 3 deletions mlir/lib/Dialect/SPIRV/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ add_mlir_dialect_library(MLIRSPIRVTransforms

DEPENDS
MLIRSPIRVPassIncGen
)

target_link_libraries(MLIRSPIRVTransforms
PUBLIC
LINK_LIBS PUBLIC
MLIRPass
MLIRSPIRV
)
6 changes: 2 additions & 4 deletions mlir/lib/Dialect/Shape/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ add_mlir_dialect_library(MLIRShape

DEPENDS
MLIRShapeOpsIncGen
)
target_link_libraries(MLIRShape
PUBLIC

LINK_LIBS PUBLIC
MLIRDialect
MLIRInferTypeOpInterface
MLIRIR
MLIRSideEffects
LLVMSupport
)
6 changes: 2 additions & 4 deletions mlir/lib/Dialect/StandardOps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ add_mlir_dialect_library(MLIRStandardOps

DEPENDS
MLIRStandardOpsIncGen
)
target_link_libraries(MLIRStandardOps
PUBLIC

LINK_LIBS PUBLIC
MLIRCallInterfaces
MLIRControlFlowInterfaces
MLIREDSC
MLIRIR
MLIRSideEffects
MLIRViewLikeInterface
LLVMSupport
)
5 changes: 2 additions & 3 deletions mlir/lib/Dialect/Vector/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ add_mlir_dialect_library(MLIRVector
DEPENDS
MLIRVectorOpsIncGen
MLIRVectorTransformPatternsIncGen
)
target_link_libraries(MLIRVector
PUBLIC

LINK_LIBS PUBLIC
MLIREDSC
MLIRIR
MLIRStandardOps
Expand Down
9 changes: 3 additions & 6 deletions mlir/lib/EDSC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ add_mlir_library(MLIREDSC

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/EDSC
)
target_link_libraries(MLIREDSC
PUBLIC

LINK_LIBS PUBLIC
MLIRIR
MLIRSupport
)
Expand All @@ -21,9 +19,8 @@ add_mlir_library(MLIREDSCInterface

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/EDSC
)
target_link_libraries(MLIREDSCInterface
PUBLIC

LINK_LIBS PUBLIC
MLIRIR
MLIRSupport
MLIRParser
Expand Down
73 changes: 48 additions & 25 deletions mlir/lib/ExecutionEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,47 +1,70 @@
# Exclude these from libMLIR.so because the JIT infrastructure
# is a big dependency which most don't need.

set(LLVM_OPTIONAL_SOURCES
CRunnerUtils.cpp
ExecutionEngine.cpp
RunnerUtils.cpp
OptUtils.cpp
)

llvm_map_components_to_libnames(outlibs "nativecodegen" "IPO")
add_mlir_library(MLIRExecutionEngine
ExecutionEngine.cpp
OptUtils.cpp

EXCLUDE_FROM_LIBMLIR

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/ExecutionEngine
)
target_link_libraries(MLIRExecutionEngine
PUBLIC

DEPENDS
intrinsics_gen

LINK_COMPONENTS
Core
ExecutionEngine
Object
OrcJIT
JITLink
Analysis
AggressiveInstCombine
InstCombine
MC
ScalarOpts
Target
Vectorize
TransformUtils
nativecodegen
IPO

LINK_LIBS PUBLIC
MLIRLLVMIR
MLIRTargetLLVMIR
LLVMExecutionEngine
LLVMObject
LLVMOrcJIT
LLVMJITLink
LLVMSupport
LLVMAnalysis
LLVMAggressiveInstCombine
LLVMInstCombine
LLVMMC
LLVMScalarOpts
LLVMTarget
LLVMVectorize
LLVMTransformUtils

${outlibs})

add_llvm_library(mlir_c_runner_utils SHARED CRunnerUtils.cpp)
)

add_mlir_library(mlir_c_runner_utils
SHARED
CRunnerUtils.cpp

EXCLUDE_FROM_LIBMLIR
)
set_property(TARGET mlir_c_runner_utils PROPERTY CXX_STANDARD 11)
add_llvm_library(mlir_c_runner_utils_static CRunnerUtils.cpp)

add_mlir_library(mlir_c_runner_utils_static
CRunnerUtils.cpp

EXCLUDE_FROM_LIBMLIR
)
set_property(TARGET mlir_c_runner_utils_static PROPERTY CXX_STANDARD 11)
target_compile_definitions(mlir_c_runner_utils PRIVATE mlir_c_runner_utils_EXPORTS)

add_llvm_library(mlir_runner_utils SHARED RunnerUtils.cpp)
target_link_libraries(mlir_runner_utils
PUBLIC
add_mlir_library(mlir_runner_utils
SHARED
RunnerUtils.cpp

EXCLUDE_FROM_LIBMLIR

LINK_LIBS PUBLIC
mlir_c_runner_utils_static
)
target_compile_definitions(mlir_runner_utils PRIVATE mlir_runner_utils_EXPORTS)
5 changes: 2 additions & 3 deletions mlir/lib/IR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ add_mlir_library(MLIRIR
MLIRCallInterfacesIncGen
MLIROpAsmInterfacesIncGen
MLIRSymbolInterfacesIncGen
)
target_link_libraries(MLIRIR
PUBLIC

LINK_LIBS PUBLIC
MLIRSupport
LLVMSupport
)
35 changes: 14 additions & 21 deletions mlir/lib/Interfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ add_mlir_library(MLIRCallInterfaces

DEPENDS
MLIRCallInterfacesIncGen
)
target_link_libraries(MLIRCallInterfaces
PUBLIC

LINK_LIBS PUBLIC
MLIRIR
)

Expand All @@ -30,9 +29,8 @@ add_mlir_library(MLIRControlFlowInterfaces

DEPENDS
MLIRControlFlowInterfacesIncGen
)
target_link_libraries(MLIRControlFlowInterfaces
PUBLIC

LINK_LIBS PUBLIC
MLIRIR
)

Expand All @@ -44,9 +42,8 @@ add_mlir_library(MLIRDerivedAttributeOpInterface

DEPENDS
MLIRDerivedAttributeOpInterfaceIncGen
)
target_link_libraries(MLIRDerivedAttributeOpInterface
PUBLIC

LINK_LIBS PUBLIC
MLIRIR
)

Expand All @@ -58,9 +55,8 @@ add_mlir_library(MLIRInferTypeOpInterface

DEPENDS
MLIRInferTypeOpInterfaceIncGen
)
target_link_libraries(MLIRInferTypeOpInterface
PUBLIC

LINK_LIBS PUBLIC
MLIRIR
)

Expand All @@ -72,9 +68,8 @@ add_mlir_library(MLIRLoopLikeInterface

DEPENDS
MLIRLoopLikeInterfaceIncGen
)
target_link_libraries(MLIRLoopLikeInterface
PUBLIC

LINK_LIBS PUBLIC
MLIRIR
)

Expand All @@ -86,9 +81,8 @@ add_mlir_library(MLIRSideEffects

DEPENDS
MLIRSideEffectOpInterfacesIncGen
)
target_link_libraries(MLIRSideEffects
PUBLIC

LINK_LIBS PUBLIC
MLIRIR
)

Expand All @@ -100,8 +94,7 @@ add_mlir_library(MLIRViewLikeInterface

DEPENDS
MLIRViewLikeInterfaceIncGen
)
target_link_libraries(MLIRViewLikeInterface
PUBLIC

LINK_LIBS PUBLIC
MLIRIR
)
6 changes: 1 addition & 5 deletions mlir/lib/Parser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ add_mlir_library(MLIRParser
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Parser

DEPENDS
mlir-generic-headers
)
target_link_libraries(MLIRParser
PUBLIC
LINK_LIBS PUBLIC
MLIRIR
)
10 changes: 6 additions & 4 deletions mlir/lib/Pass/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ add_mlir_library(MLIRPass

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Pass
)
target_link_libraries(MLIRPass
PUBLIC

DEPENDS
mlir-generic-headers

LINK_LIBS PUBLIC
MLIRAnalysis
MLIRIR
LLVMSupport)
)
40 changes: 26 additions & 14 deletions mlir/lib/Support/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,45 @@ add_mlir_library(MLIRSupport

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Support
)
target_link_libraries(MLIRSupport
PUBLIC
LLVMSupport

LINK_COMPONENTS
Support

LINK_LIBS PUBLIC
${LLVM_PTHREAD_LIB})

add_mlir_library(MLIROptLib
MlirOptMain.cpp

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Support
)
target_link_libraries(MLIROptLib
PUBLIC

LINK_COMPONENTS
Support

LINK_LIBS PUBLIC
MLIRPass
MLIRParser
LLVMSupport
MLIRSupport
)

add_llvm_library(MLIRJitRunner
# Exclude from libMLIR.so because the JIT infrastructure
# is a big dependency which most don't need.
add_mlir_library(MLIRJitRunner
JitRunner.cpp
)
target_link_libraries(MLIRJitRunner
PUBLIC

DEPENDS
intrinsics_gen

EXCLUDE_FROM_LIBMLIR

LINK_COMPONENTS
Core
OrcJIT
JITLink
Support

LINK_LIBS PUBLIC
MLIRExecutionEngine
MLIRIR
MLIRParser
Expand All @@ -46,6 +60,4 @@ target_link_libraries(MLIRJitRunner
MLIRTransforms
MLIRStandardToLLVM
MLIRSupport
LLVMCore
LLVMSupport
)
18 changes: 13 additions & 5 deletions mlir/lib/TableGen/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
add_llvm_library(LLVMMLIRTableGen
# This library is unusual, since mlir-tblgen depends on it.
# For non-obvious reasons, linking mlir-tblgen fails with
# LLVM_BUILD_LLVM_DYLIB and LLVM_LINK_LLVM_DYLIB unless
# DISABLE_LLVM_LINK_LLVM_DYLIB is set.
llvm_add_library(LLVMMLIRTableGen STATIC
Argument.cpp
Attribute.cpp
Constraint.cpp
Expand All @@ -16,10 +20,14 @@ add_llvm_library(LLVMMLIRTableGen
Successor.cpp
Type.cpp

DISABLE_LLVM_LINK_LLVM_DYLIB

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/TableGen

LINK_COMPONENTS
TableGen
Demangle
)
target_link_libraries(LLVMMLIRTableGen
PUBLIC
LLVMSupport
LLVMTableGen)

mlir_check_all_link_libraries(LLVMMLIRTableGen)
51 changes: 32 additions & 19 deletions mlir/lib/Target/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ add_mlir_translation_library(MLIRTargetLLVMIRModuleTranslation

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Target/LLVMIR

DEPENDS
intrinsics_gen
)
target_link_libraries(MLIRTargetLLVMIRModuleTranslation
PUBLIC

LINK_COMPONENTS
Core
FrontendOpenMP
TransformUtils

LINK_LIBS PUBLIC
MLIRLLVMIR
MLIRLLVMIRTransforms
LLVMCore
LLVMIRReader
LLVMSupport
LLVMTransformUtils
MLIRTranslation
)

Expand All @@ -23,11 +24,14 @@ add_mlir_translation_library(MLIRTargetAVX512

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Target/LLVMIR

DEPENDS
MLIRLLVMAVX512ConversionsIncGen
)
target_link_libraries(MLIRTargetAVX512
PUBLIC

LINK_COMPONENTS
Core

LINK_LIBS PUBLIC
MLIRIR
MLIRLLVMAVX512
MLIRLLVMIR
Expand All @@ -40,9 +44,12 @@ add_mlir_translation_library(MLIRTargetLLVMIR

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Target/LLVMIR
)
target_link_libraries(MLIRTargetLLVMIR
PUBLIC

LINK_COMPONENTS
Core
IRReader

LINK_LIBS PUBLIC
MLIRTargetLLVMIRModuleTranslation
)

Expand All @@ -51,11 +58,14 @@ add_mlir_translation_library(MLIRTargetNVVMIR

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Target/LLVMIR

DEPENDS
intrinsics_gen
)
target_link_libraries(MLIRTargetNVVMIR
PUBLIC

LINK_COMPONENTS
Core

LINK_LIBS PUBLIC
MLIRGPU
MLIRIR
MLIRLLVMIR
Expand All @@ -68,11 +78,14 @@ add_mlir_translation_library(MLIRTargetROCDLIR

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Target/LLVMIR

DEPENDS
intrinsics_gen
)
target_link_libraries(MLIRTargetROCDLIR
PUBLIC

LINK_COMPONENTS
Core

LINK_LIBS PUBLIC
MLIRGPU
MLIRIR
MLIRLLVMIR
Expand Down
4 changes: 1 addition & 3 deletions mlir/lib/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ add_mlir_library(MLIRTransforms
DEPENDS
MLIRStandardOpsIncGen
MLIRTransformsPassIncGen
)

target_link_libraries(MLIRTransforms
PUBLIC
LINK_LIBS PUBLIC
MLIRAffineOps
MLIRAnalysis
MLIRLoopLikeInterface
Expand Down
4 changes: 1 addition & 3 deletions mlir/lib/Transforms/Utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ add_mlir_library(MLIRTransformUtils

DEPENDS
MLIRStandardOpsIncGen
)

target_link_libraries(MLIRTransformUtils
PUBLIC
LINK_LIBS PUBLIC
MLIRAffineOps
MLIRAnalysis
MLIRLoopAnalysis
Expand Down
6 changes: 2 additions & 4 deletions mlir/lib/Translation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ add_mlir_library(MLIRTranslation

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Translation
)
target_link_libraries(MLIRTranslation
PUBLIC
LLVMSupport

LINK_LIBS PUBLIC
MLIRIR
MLIRParser
)
8 changes: 5 additions & 3 deletions mlir/test/EDSC/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
set(LLVM_LINK_COMPONENTS
Core
Support
)
add_llvm_executable(mlir-edsc-builder-api-test
builder-api-test.cpp
)
Expand All @@ -16,8 +20,6 @@ target_link_libraries(mlir-edsc-builder-api-test
MLIRStandardOps
MLIRTransforms
MLIRVector
LLVMCore
LLVMSupport
)
)

target_include_directories(mlir-edsc-builder-api-test PRIVATE ..)
7 changes: 5 additions & 2 deletions mlir/test/SDBM/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
set(LLVM_LINK_COMPONENTS
Core
Support
)

add_llvm_executable(mlir-sdbm-api-test
sdbm-api-test.cpp
)
Expand All @@ -9,8 +14,6 @@ target_link_libraries(mlir-sdbm-api-test
MLIRIR
MLIRSDBM
MLIRSupport
LLVMCore
LLVMSupport
)

target_include_directories(mlir-sdbm-api-test PRIVATE ..)
11 changes: 8 additions & 3 deletions mlir/test/lib/Dialect/Affine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
add_llvm_library(MLIRAffineTransformsTestPasses
# Exclude tests from libMLIR.so
add_mlir_library(MLIRAffineTransformsTestPasses
TestAffineDataCopy.cpp
TestAffineLoopUnswitching.cpp
TestLoopPermutation.cpp
TestParallelismDetection.cpp
TestVectorizationUtils.cpp

EXCLUDE_FROM_LIBMLIR

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Affine
${MLIR_MAIN_INCLUDE_DIR}/mlir/IR
)

target_link_libraries(MLIRAffineTransformsTestPasses PRIVATE
LINK_COMPONENTS
Core

LINK_LIBS PUBLIC
MLIRIR
MLIRPass
MLIRAffineTransforms
Expand Down
8 changes: 5 additions & 3 deletions mlir/test/lib/Dialect/SPIRV/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
add_llvm_library(MLIRSPIRVTestPasses
# Exclude tests from libMLIR.so
add_mlir_library(MLIRSPIRVTestPasses
TestAvailability.cpp

EXCLUDE_FROM_LIBMLIR

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/SPIRV
${MLIR_MAIN_INCLUDE_DIR}/mlir/IR
)

target_link_libraries(MLIRSPIRVTestPasses PRIVATE
LINK_LIBS PUBLIC
MLIRIR
MLIRPass
MLIRSPIRV
Expand Down
11 changes: 6 additions & 5 deletions mlir/test/lib/Dialect/Test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@ mlir_tablegen(TestOpStructs.cpp.inc -gen-struct-attr-defs)
mlir_tablegen(TestPatterns.inc -gen-rewriters)
add_public_tablegen_target(MLIRTestOpsIncGen)

add_llvm_library(MLIRTestDialect
# Exclude tests from libMLIR.so
add_mlir_library(MLIRTestDialect
TestDialect.cpp
TestPatterns.cpp

EXCLUDE_FROM_LIBMLIR

DEPENDS
MLIRTestOpsIncGen
)
target_link_libraries(MLIRTestDialect
PUBLIC
LLVMSupport

LINK_LIBS PUBLIC
MLIRControlFlowInterfaces
MLIRDerivedAttributeOpInterface
MLIRDialect
Expand Down
13 changes: 6 additions & 7 deletions mlir/test/lib/IR/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
add_llvm_library(MLIRTestIR
# Exclude tests from libMLIR.so
add_mlir_library(MLIRTestIR
TestFunc.cpp
TestMatchers.cpp
TestSideEffects.cpp
TestSymbolUses.cpp

ADDITIONAL_HEADER_DIRS
)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../Dialect/Test)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/../Dialect/Test)
EXCLUDE_FROM_LIBMLIR

target_link_libraries(MLIRTestIR
PUBLIC
LINK_LIBS PUBLIC
MLIRPass
MLIRTestDialect
)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../Dialect/Test)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/../Dialect/Test)
10 changes: 6 additions & 4 deletions mlir/test/lib/Pass/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
add_llvm_library(MLIRTestPass
# Exclude tests from libMLIR.so
add_mlir_library(MLIRTestPass
TestPassManager.cpp

EXCLUDE_FROM_LIBMLIR

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Pass
)
target_link_libraries(MLIRTestPass
PUBLIC

LINK_LIBS PUBLIC
MLIRIR
MLIRPass
)
19 changes: 10 additions & 9 deletions mlir/test/lib/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
add_llvm_library(MLIRTestTransforms
# Exclude tests from libMLIR.so
add_mlir_library(MLIRTestTransforms
TestAllReduceLowering.cpp
TestBufferPlacement.cpp
TestCallGraph.cpp
Expand All @@ -20,21 +21,16 @@ add_llvm_library(MLIRTestTransforms
TestVectorToLoopsConversion.cpp
TestVectorTransforms.cpp

EXCLUDE_FROM_LIBMLIR

ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Transforms

DEPENDS
MLIRStandardOpsIncGen
MLIRTestVectorTransformPatternsIncGen
)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../Dialect/Test)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/../Dialect/Test)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../DeclarativeTransforms)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/../DeclarativeTransforms)

target_link_libraries(MLIRTestTransforms
PUBLIC
LINK_LIBS PUBLIC
MLIRAffineOps
MLIRAnalysis
MLIREDSC
Expand All @@ -51,3 +47,8 @@ target_link_libraries(MLIRTestTransforms
MLIRVectorToLoops
MLIRVector
)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../Dialect/Test)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/../Dialect/Test)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../DeclarativeTransforms)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/../DeclarativeTransforms)
10 changes: 7 additions & 3 deletions mlir/tools/mlir-cpu-runner/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
set(LLVM_LINK_COMPONENTS
Core
Support
nativecodegen
)

add_llvm_tool(mlir-cpu-runner
mlir-cpu-runner.cpp
)
)
llvm_update_compile_flags(mlir-cpu-runner)
get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
target_link_libraries(mlir-cpu-runner PRIVATE
Expand All @@ -14,6 +20,4 @@ target_link_libraries(mlir-cpu-runner PRIVATE
MLIRParser
MLIRTargetLLVMIR
MLIRSupport
LLVMCore
LLVMSupport
)
6 changes: 4 additions & 2 deletions mlir/tools/mlir-linalg-ods-gen/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
set(LLVM_LINK_COMPONENTS
Core
Support
)
add_llvm_tool(mlir-linalg-ods-gen
mlir-linalg-ods-gen.cpp
)
llvm_update_compile_flags(mlir-linalg-ods-gen)
target_link_libraries(mlir-linalg-ods-gen PRIVATE
MLIRParser
MLIRSupport
LLVMCore
LLVMSupport
)
32 changes: 21 additions & 11 deletions mlir/tools/mlir-opt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ set(LLVM_OPTIONAL_SOURCES

get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
set(LLVM_LINK_COMPONENTS
Core
Support
AsmParser
)

set(LIBS
${dialect_libs}
${conversion_libs}
Expand All @@ -25,22 +31,26 @@ set(LIBS
MLIRSupport
MLIRIR
MLIROptLib
LLVMSupport
LLVMCore
LLVMAsmParser
)

add_llvm_library(MLIRMlirOptMain
# Exclude from libMLIR.so because this has static options intended for
# opt-like tools only.
add_mlir_library(MLIRMlirOptMain
mlir-opt.cpp
)
target_link_libraries(MLIRMlirOptMain
PUBLIC

EXCLUDE_FROM_LIBMLIR

LINK_LIBS
${LIBS}
)
)

add_llvm_tool(mlir-opt
mlir-opt.cpp
)
mlir-opt.cpp

DEPENDS
${LIBS}
)
target_link_libraries(mlir-opt PRIVATE ${LIBS})
llvm_update_compile_flags(mlir-opt)
target_link_libraries(mlir-opt PRIVATE ${LIBS} ${targets_to_link})

mlir_check_link_libraries(mlir-opt)
31 changes: 21 additions & 10 deletions mlir/tools/mlir-shlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ if (MSVC)
return()
endif()

get_property(mlir_libs GLOBAL PROPERTY MLIR_ALL_LIBS)
get_property(mlir_libs GLOBAL PROPERTY MLIR_STATIC_LIBS)
get_property(mlir_llvm_link_components GLOBAL PROPERTY MLIR_LLVM_LINK_COMPONENTS)
list(REMOVE_DUPLICATES mlir_libs)
list(REMOVE_DUPLICATES mlir_llvm_link_components)

foreach (lib ${mlir_libs})
if(XCODE)
Expand All @@ -19,23 +21,32 @@ foreach (lib ${mlir_libs})
else()
list(APPEND _OBJECTS $<TARGET_OBJECTS:obj.${lib}>)
endif()
list(APPEND _DEPS $<TARGET_PROPERTY:${lib},LINK_LIBRARIES>)
# libClang needs this, but it causes problems for MLIR (probably
# because we use public library dependencies within MLIR.)
# list(APPEND _DEPS $<TARGET_PROPERTY:${lib},LINK_LIBRARIES>)
endforeach ()

if(MLIR_LINK_MLIR_DYLIB)
set(INSTALL_WITH_TOOLCHAIN INSTALL_WITH_TOOLCHAIN)
endif()

# libMLIR.so depends on LLVM components. To avoid multiple
# copies of those LLVM components, libMLIR.so depends on libLLVM.so.
# This probably won't work if some LLVM components are not included
# in libLLVM.so.
if(LLVM_BUILD_LLVM_DYLIB)
add_llvm_library(MLIR
add_mlir_library(
MLIR
SHARED
${INSTALL_WITH_TOOLCHAIN}

mlir-shlib.cpp
)
target_link_libraries(MLIR PRIVATE LLVM ${LLVM_PTHREAD_LIB})
${_OBJECTS}
LINK_LIBS
${_DEPS}

LINK_COMPONENTS
${mlir_llvm_link_components}
)
target_link_libraries(MLIR PRIVATE ${LLVM_PTHREAD_LIB})
endif()

#message("Libraries included in libMLIR.so: ${mlir_libs}")
#message("LLVM Components included in libMLIR.so: ${mlir_llvm_link_components}")

mlir_check_all_link_libraries(MLIR)
9 changes: 8 additions & 1 deletion mlir/tools/mlir-tblgen/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
set(LLVM_LINK_COMPONENTS
MLIRTableGen
Demangle
Support
TableGen
)

add_tablegen(mlir-tblgen MLIR
Expand All @@ -19,4 +20,10 @@ add_tablegen(mlir-tblgen MLIR
SPIRVUtilsGen.cpp
StructsGen.cpp
)

set_target_properties(mlir-tblgen PROPERTIES FOLDER "Tablegenning")
target_link_libraries(mlir-tblgen
PRIVATE
LLVMMLIRTableGen)

mlir_check_all_link_libraries(mlir-tblgen)
22 changes: 15 additions & 7 deletions mlir/tools/mlir-translate/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
set(LLVM_LINK_COMPONENTS
Support
)

get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
get_property(translation_libs GLOBAL PROPERTY MLIR_TRANSLATION_LIBS)
set(LIBS

add_llvm_tool(mlir-translate
mlir-translate.cpp
)
llvm_update_compile_flags(mlir-translate)
target_link_libraries(mlir-translate
PRIVATE
${dialect_libs}
${translation_libs}
MLIRIR
MLIRParser
MLIRPass
MLIRSPIRV
MLIRTranslation
MLIRSupport
)
add_llvm_tool(mlir-translate
mlir-translate.cpp
)
llvm_update_compile_flags(mlir-translate)
target_link_libraries(mlir-translate PRIVATE MLIRIR MLIRTranslation ${LIBS} LLVMSupport)
)

mlir_check_link_libraries(mlir-translate)