diff options
author | Brad King <brad.king@kitware.com> | 2022-03-29 14:00:14 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-03-29 14:29:25 (GMT) |
commit | b4de4217aefedaf46cbb1d700cbd463c3d2d8914 (patch) | |
tree | 76fc5a581f24214e05cb7ede60dfee5c29b8b202 | |
parent | 2a88b807ce96cd783795f6813a5789e2617175ec (diff) | |
download | CMake-b4de4217aefedaf46cbb1d700cbd463c3d2d8914.zip CMake-b4de4217aefedaf46cbb1d700cbd463c3d2d8914.tar.gz CMake-b4de4217aefedaf46cbb1d700cbd463c3d2d8914.tar.bz2 |
Tests: Simplify RunCMake.CompilerArgs no-clean cases
Also distinguish between the toolchain and env cases in the output.
-rw-r--r-- | Tests/RunCMake/CompilerArgs/RunCMakeTest.cmake | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/Tests/RunCMake/CompilerArgs/RunCMakeTest.cmake b/Tests/RunCMake/CompilerArgs/RunCMakeTest.cmake index 9e5a18a..5e8b39b 100644 --- a/Tests/RunCMake/CompilerArgs/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompilerArgs/RunCMakeTest.cmake @@ -19,12 +19,6 @@ function(run_compiler_env lang) # Use the correct compiler include(${RunCMake_BINARY_DIR}/Find${lang}Compiler-build/${lang}_comp.cmake) - # Use a single build tree for tests without cleaning. - set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${lang}-env-build) - set(RunCMake_TEST_NO_CLEAN 1) - file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") - file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") - # Set the compiler if(lang STREQUAL "C") set(ENV{CC} "'${temp_CMAKE_${lang}_COMPILER}' -DFOO1 -DFOO2") @@ -32,20 +26,21 @@ function(run_compiler_env lang) set(ENV{${lang}} "'${temp_CMAKE_${lang}_COMPILER}' -DFOO1 -DFOO2") endif() + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${lang}-env-build) + set(RunCMake_TEST_VARIANT_DESCRIPTION "-env") run_cmake(${lang}) + set(RunCMake_TEST_NO_CLEAN 1) run_cmake_command(${lang}-Build ${CMAKE_COMMAND} --build . ${verbose_args}) endfunction() function(run_compiler_tc lang) - # Use a single build tree for tests without cleaning. - set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${lang}-tc-build) - set(RunCMake_TEST_NO_CLEAN 1) - file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") - file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") - set(RunCMake_TEST_OPTIONS -DCMAKE_TOOLCHAIN_FILE=${RunCMake_BINARY_DIR}/Find${lang}Compiler-build/toolchain_${lang}_comp.cmake) + + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${lang}-tc-build) + set(RunCMake_TEST_VARIANT_DESCRIPTION "-tc") run_cmake(${lang}) + set(RunCMake_TEST_NO_CLEAN 1) run_cmake_command(${lang}-Build ${CMAKE_COMMAND} --build . ${verbose_args}) endfunction() |