mirror of
https://github.com/Kitware/CMake.git
synced 2026-07-01 12:18:01 +00:00
Tests/CXXModules: support testing with custom stdlib json locations
This commit is contained in:
@@ -827,6 +827,7 @@ set_property(TEST RunCMake.DependencyGraph APPEND PROPERTY LABELS "Fortran")
|
||||
add_RunCMake_test(CXXModules
|
||||
-DCMake_TEST_MODULE_COMPILATION=${CMake_TEST_MODULE_COMPILATION}
|
||||
-DCMake_TEST_MODULE_COMPILATION_RULES=${CMake_TEST_MODULE_COMPILATION_RULES}
|
||||
-DCMake_TEST_CXX_STDLIB_MODULES_JSON=${CMake_TEST_CXX_STDLIB_MODULES_JSON}
|
||||
)
|
||||
|
||||
# ctresalloc links against CMakeLib and CTestLib, which means it can't be built
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
include(RunCMake)
|
||||
|
||||
run_cmake(Inspect)
|
||||
set(stdlib_custom_json)
|
||||
if (CMake_TEST_CXX_STDLIB_MODULES_JSON)
|
||||
list(APPEND stdlib_custom_json
|
||||
-DCMAKE_CXX_STDLIB_MODULES_JSON=${CMake_TEST_CXX_STDLIB_MODULES_JSON})
|
||||
endif ()
|
||||
|
||||
run_cmake(Inspect ${stdlib_custom_json})
|
||||
include("${RunCMake_BINARY_DIR}/Inspect-build/info.cmake")
|
||||
|
||||
# Test negative cases where C++20 modules do not work.
|
||||
@@ -149,6 +155,10 @@ function (run_cxx_module_test directory)
|
||||
else ()
|
||||
set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug)
|
||||
endif ()
|
||||
if (directory MATCHES "import-std")
|
||||
list(APPEND RunCMake_TEST_OPTIONS
|
||||
${stdlib_custom_json})
|
||||
endif ()
|
||||
|
||||
if (RunCMake_CXXModules_INSTALL)
|
||||
set(prefix "${RunCMake_BINARY_DIR}/examples/${test_name}-install")
|
||||
|
||||
Reference in New Issue
Block a user