llvm/mlir/tools/mlir-opt/CMakeLists.txt
2020-02-19 14:51:09 +01:00

97 lines
1.8 KiB
CMake

set(LLVM_OPTIONAL_SOURCES
null.cpp
)
set(LIB_LIBS
MLIRAnalysis
MLIRLLVMIR
MLIROptLib
MLIRParser
MLIRPass
MLIRTransforms
MLIRSupport
)
add_llvm_library(MLIRMlirOptMain
mlir-opt.cpp
)
target_link_libraries(MLIRMlirOptMain
${LIB_LIBS}
)
set(LIBS
MLIRLoopOpsTransforms
MLIRLoopAnalysis
MLIRAnalysis
MLIRAffineOps
MLIRAffineToStandard
MLIRDialect
MLIRLoopsToGPU
MLIRLinalgToLLVM
MLIRLoopToStandard
MLIREDSC
MLIRFxpMathOps
MLIRGPU
MLIRGPUtoCUDATransforms
MLIRGPUtoNVVMTransforms
MLIRGPUtoROCDLTransforms
MLIRGPUtoSPIRVTransforms
MLIRGPUtoVulkanTransforms
MLIRLinalgOps
MLIRLinalgAnalysis
MLIRLinalgEDSC
MLIRLinalgTransforms
MLIRLinalgUtils
MLIRLLVMIR
MLIRLoopOps
MLIRNVVMIR
MLIROpenMP
MLIROptLib
MLIRParser
MLIRPass
MLIRQuantizerFxpMathConfig
MLIRQuantizerSupport
MLIRQuantizerTransforms
MLIRQuantOps
MLIRROCDLIR
MLIRSPIRV
MLIRLinalgToSPIRVTransforms
MLIRStandardToSPIRVTransforms
MLIRSPIRVTestPasses
MLIRSPIRVTransforms
MLIRStandardOps
MLIRStandardToLLVM
MLIRTransforms
MLIRTransformUtils
MLIRTestDialect
MLIRTestIR
MLIRTestPass
MLIRTestTransforms
MLIRSupport
MLIRVectorOps
MLIRVectorToLLVM
MLIRVectorToLoops
MLIRIR
MLIROptLib
LLVMSupport
LLVMCore
LLVMAsmParser
)
add_llvm_tool(mlir-opt
mlir-opt.cpp
)
# Manually expand the target library, since our MLIR libraries
# aren't plugged into the LLVM dependency tracking. If we don't
# do this then we can't insert the CodeGen library after ourselves
llvm_expand_pseudo_components(TARGET_LIBS AllTargetsCodeGens)
# Prepend LLVM in front of every target, this is how the library
# are named with CMake
SET(targets_to_link)
FOREACH(t ${TARGET_LIBS})
LIST(APPEND targets_to_link "LLVM${t}")
ENDFOREACH(t)
llvm_update_compile_flags(mlir-opt)
target_link_libraries(mlir-opt PRIVATE ${LIBS} ${targets_to_link})