diff options
author | Krzysztof Drewniak <Krzysztof.Drewniak@amd.com> | 2021-06-02 17:21:17 +0000 |
---|---|---|
committer | Mehdi Amini <joker.eph@gmail.com> | 2021-06-02 17:24:46 +0000 |
commit | b532455ac7038bfb59b858a1bbcb6d2941f5dbcc (patch) | |
tree | 4a516b61adf2c1888281cbab7bcdd2a9e5de9362 /mlir/test/Examples | |
parent | 0ec761c3fc2a4bf8319c6eb38e46f9a201b79141 (diff) | |
download | llvm-b532455ac7038bfb59b858a1bbcb6d2941f5dbcc.zip llvm-b532455ac7038bfb59b858a1bbcb6d2941f5dbcc.tar.gz llvm-b532455ac7038bfb59b858a1bbcb6d2941f5dbcc.tar.bz2 |
[MLIR] Fix Standalone dialect test to work in out-of-tree builds
When LLVM and MLIR are built as subprojects (via add_subdirectory),
the CMake configuration that indicates where the MLIR libraries are is
not necessarily in the same cmake/ directory as LLVM's configuration.
This patch removes that assumption about where MLIRConfig.cmake is
located.
(As an additional none, the %llvm_lib_dir substitution was never
defined, and so find_package(MLIR) in the build was succeeding for
other reasons.)
Reviewed By: stephenneuendorffer
Differential Revision: https://reviews.llvm.org/D103276
Diffstat (limited to 'mlir/test/Examples')
-rw-r--r-- | mlir/test/Examples/standalone/lit.local.cfg | 2 | ||||
-rw-r--r-- | mlir/test/Examples/standalone/test.toy | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/mlir/test/Examples/standalone/lit.local.cfg b/mlir/test/Examples/standalone/lit.local.cfg index 1744d78..2ec53bd 100644 --- a/mlir/test/Examples/standalone/lit.local.cfg +++ b/mlir/test/Examples/standalone/lit.local.cfg @@ -2,3 +2,5 @@ config.substitutions.append(("%cmake", config.host_cmake)) config.substitutions.append(("%host_cxx", config.host_cxx)) config.substitutions.append(("%host_cc", config.host_cc)) config.substitutions.append(("%enable_libcxx", config.enable_libcxx)) +config.substitutions.append( + ("%mlir_cmake_dir", config.mlir_cmake_dir)) diff --git a/mlir/test/Examples/standalone/test.toy b/mlir/test/Examples/standalone/test.toy index 0f9d0cc..dd22e45 100644 --- a/mlir/test/Examples/standalone/test.toy +++ b/mlir/test/Examples/standalone/test.toy @@ -1,4 +1,4 @@ -# RUN: %cmake %mlir_src_root/examples/standalone -DCMAKE_CXX_COMPILER=%host_cxx -DCMAKE_C_COMPILER=%host_cc -DLLVM_ENABLE_LIBCXX=%enable_libcxx -DMLIR_DIR=%llvm_lib_dir/cmake/mlir ; %cmake --build . --target check-standalone | tee %t | FileCheck %s +# RUN: %cmake %mlir_src_root/examples/standalone -DCMAKE_CXX_COMPILER=%host_cxx -DCMAKE_C_COMPILER=%host_cc -DLLVM_ENABLE_LIBCXX=%enable_libcxx -DMLIR_DIR=%mlir_cmake_dir ; %cmake --build . --target check-standalone | tee %t | FileCheck %s # CHECK: Passed: 3 # UNSUPPORTED: windows, android |