diff options
Diffstat (limited to 'Tests/RunCMake/CXXModules/RunCMakeTest.cmake')
-rw-r--r-- | Tests/RunCMake/CXXModules/RunCMakeTest.cmake | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake index 2938fa8..e687e9f 100644 --- a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake +++ b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake @@ -133,7 +133,11 @@ function (run_cxx_module_test directory) ${ARGN}) run_cmake("examples/${test_name}") set(RunCMake_TEST_NO_CLEAN 1) - run_cmake_command("examples/${test_name}-build" "${CMAKE_COMMAND}" --build . --config Debug) + if (RunCMake_CXXModules_TARGET) + run_cmake_command("examples/${test_name}-build" "${CMAKE_COMMAND}" --build . --config Debug --target "${RunCMake_CXXModules_TARGET}") + else () + run_cmake_command("examples/${test_name}-build" "${CMAKE_COMMAND}" --build . --config Debug) + endif () if (RunCMake_CXXModules_INSTALL) run_cmake_command("examples/${test_name}-install" "${CMAKE_COMMAND}" --build . --target install --config Debug) endif () @@ -142,8 +146,23 @@ function (run_cxx_module_test directory) endif () endfunction () +function (run_cxx_module_test_target directory target) + set(RunCMake_CXXModules_TARGET "${target}") + set(RunCMake_CXXModules_NO_TEST 1) + run_cxx_module_test("${directory}" ${ARGN}) +endfunction () + string(REPLACE "," ";" CMake_TEST_MODULE_COMPILATION "${CMake_TEST_MODULE_COMPILATION}") +if (RunCMake_GENERATOR MATCHES "Ninja") + if (RunCMake_GENERATOR_IS_MULTI_CONFIG) + set(ninja_cmp0154_target "CMakeFiles/ninja_cmp0154.dir/Debug/unrelated.cxx${CMAKE_CXX_OUTPUT_EXTENSION}") + else () + set(ninja_cmp0154_target "CMakeFiles/ninja_cmp0154.dir/unrelated.cxx${CMAKE_CXX_OUTPUT_EXTENSION}") + endif () + run_cxx_module_test_target(ninja-cmp0154 "${ninja_cmp0154_target}") +endif () + # Tests which use named modules. if ("named" IN_LIST CMake_TEST_MODULE_COMPILATION) run_cxx_module_test(simple) |