[MLIR] Fix checks for native arch
authorNikita Popov <npopov@redhat.com>
Wed, 3 Aug 2022 13:28:49 +0000 (15:28 +0200)
committerNikita Popov <npopov@redhat.com>
Thu, 4 Aug 2022 09:10:08 +0000 (11:10 +0200)
commit57a9bccec7dea036dbfa1a78f1ec5e73ecf7a33c
treeeaf6a25d1da81a071071b8d478d4ad405928ed22
parent7ce321e5b0a431d8fde69ce03d1bd7254a7dc00c
[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
mlir/CMakeLists.txt
mlir/lib/CAPI/CMakeLists.txt
mlir/lib/ExecutionEngine/CMakeLists.txt
mlir/python/CMakeLists.txt
mlir/test/CAPI/CMakeLists.txt
mlir/test/CMakeLists.txt
mlir/tools/CMakeLists.txt
mlir/unittests/CMakeLists.txt