llvm-project/mlir/unittests/CMakeLists.txt
Nikita Popov 57a9bccec7 [MLIR] Fix checks for native arch
Using if (TARGET ${LLVM_NATIVE_ARCH}) only works if MLIR is built
together with LLVM, but not for standalone builds of MLIR. The
correct way to check this is
if (${LLVM_NATIVE_ARCH} IN_LIST LLVM_TARGETS_TO_BUILD), as the
LLVM build system exports LLVM_TARGETS_TO_BUILD.

To avoid repeating the same check many times, add a
MLIR_ENABLE_EXECUTION_ENGINE variable.

Differential Revision: https://reviews.llvm.org/D131071
2022-08-04 11:10:08 +02:00

22 lines
545 B
CMake

set_target_properties(MLIRUnitTests PROPERTIES FOLDER "MLIR Tests")
function(add_mlir_unittest test_dirname)
add_unittest(MLIRUnitTests ${test_dirname} ${ARGN})
endfunction()
add_subdirectory(Analysis)
add_subdirectory(Conversion)
add_subdirectory(Dialect)
add_subdirectory(Interfaces)
add_subdirectory(IR)
add_subdirectory(Parser)
add_subdirectory(Pass)
add_subdirectory(Support)
add_subdirectory(Rewrite)
add_subdirectory(TableGen)
add_subdirectory(Transforms)
if(MLIR_ENABLE_EXECUTION_ENGINE)
add_subdirectory(ExecutionEngine)
endif()