From e94e55712c0adb49adcd14c1839e9e30a8e2e6f1 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Mon, 8 Mar 2021 05:06:33 +0000 Subject: [PATCH] Forward the `LLVM_ENABLE_LIBCXX` CMake parameter to the mlir standalone test This allows to build and test MLIR with `-DLLVM_ENABLE_LIBCXX=ON`. --- mlir/examples/standalone/test/lit.site.cfg.py.in | 1 + mlir/test/Examples/standalone/lit.local.cfg | 1 + mlir/test/Examples/standalone/test.toy | 2 +- mlir/test/lit.site.cfg.py.in | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/mlir/examples/standalone/test/lit.site.cfg.py.in b/mlir/examples/standalone/test/lit.site.cfg.py.in index 669bea9..26fb8aa 100644 --- a/mlir/examples/standalone/test/lit.site.cfg.py.in +++ b/mlir/examples/standalone/test/lit.site.cfg.py.in @@ -23,6 +23,7 @@ config.llvm_bindings = "@LLVM_BINDINGS@".split(' ') config.host_os = "@HOST_OS@" config.host_cc = "@HOST_CC@" config.host_cxx = "@HOST_CXX@" +config.enable_libcxx = "@LLVM_ENABLE_LIBCXX@" # Note: ldflags can contain double-quoted paths, so must use single quotes here. config.host_ldflags = '@HOST_LDFLAGS@' config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@" diff --git a/mlir/test/Examples/standalone/lit.local.cfg b/mlir/test/Examples/standalone/lit.local.cfg index 481b809..1744d78 100644 --- a/mlir/test/Examples/standalone/lit.local.cfg +++ b/mlir/test/Examples/standalone/lit.local.cfg @@ -1,3 +1,4 @@ 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)) diff --git a/mlir/test/Examples/standalone/test.toy b/mlir/test/Examples/standalone/test.toy index 7b4a9c2..0f9d0cc 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 -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=%llvm_lib_dir/cmake/mlir ; %cmake --build . --target check-standalone | tee %t | FileCheck %s # CHECK: Passed: 3 # UNSUPPORTED: windows, android diff --git a/mlir/test/lit.site.cfg.py.in b/mlir/test/lit.site.cfg.py.in index c34e7e4..1d98d94d 100644 --- a/mlir/test/lit.site.cfg.py.in +++ b/mlir/test/lit.site.cfg.py.in @@ -23,6 +23,7 @@ config.llvm_bindings = "@LLVM_BINDINGS@".split(' ') config.host_os = "@HOST_OS@" config.host_cc = "@HOST_CC@" config.host_cxx = "@HOST_CXX@" +config.enable_libcxx = "@LLVM_ENABLE_LIBCXX@" config.host_cmake = "@CMAKE_COMMAND@" # Note: ldflags can contain double-quoted paths, so must use single quotes here. config.host_ldflags = '@HOST_LDFLAGS@' -- 2.7.4