| 1 |
get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS) |
| 2 |
get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS) |
| 3 |
|
| 4 |
include_directories(${LLVM_MAIN_SRC_DIR}/../mlir/include) |
| 5 |
include_directories(${CMAKE_BINARY_DIR}/tools/mlir/include) |
| 6 |
|
| 7 |
# GCC, unlike clang, issues a warning when one virtual function is overridden |
| 8 |
# in a derived class but one or more other virtual functions with the same |
| 9 |
# name and different signature from a base class are not overridden. This |
| 10 |
# leads to many warnings in the MLIR and ClangIR code when using the |
| 11 |
# OpenConversionPattern<>::matchAndRewrite() function in the ordinary way. |
| 12 |
# The "hiding" behavior is what we want, so we're just disabling the warning |
| 13 |
# here. |
| 14 |
if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND (NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")) |
| 15 |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-overloaded-virtual") |
| 16 |
endif() |
| 17 |
|
| 18 |
add_clang_tool(cir-opt |
| 19 |
cir-opt.cpp |
| 20 |
) |
| 21 |
|
| 22 |
clang_target_link_libraries(cir-opt |
| 23 |
PRIVATE |
| 24 |
clangCIR |
| 25 |
clangCIRLoweringDirectToLLVM |
| 26 |
MLIRCIR |
| 27 |
MLIRCIRTransforms |
| 28 |
) |
| 29 |
|
| 30 |
target_link_libraries(cir-opt |
| 31 |
PRIVATE |
| 32 |
${dialect_libs} |
| 33 |
${conversion_libs} |
| 34 |
MLIRAnalysis |
| 35 |
MLIRDialect |
| 36 |
MLIRIR |
| 37 |
MLIRMemRefDialect |
| 38 |
MLIROptLib |
| 39 |
MLIRParser |
| 40 |
MLIRPass |
| 41 |
MLIRSideEffectInterfaces |
| 42 |
MLIRTransforms |
| 43 |
MLIRTransformUtils |
| 44 |
) |