diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2020-01-10 18:13:09 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2020-01-11 00:25:25 (GMT) |
commit | 2678e310537a965b531cfc2c1f54fc72aac9d7d5 (patch) | |
tree | 6eaba42609646e732b70a71302095b87853d543e /Tests/RunCMake/target_compile_options/RunCMakeTest.cmake | |
parent | 3795dea6f1d4ca9bc1a2131173ed190f6c362fbe (diff) | |
download | CMake-2678e310537a965b531cfc2c1f54fc72aac9d7d5.zip CMake-2678e310537a965b531cfc2c1f54fc72aac9d7d5.tar.gz CMake-2678e310537a965b531cfc2c1f54fc72aac9d7d5.tar.bz2 |
target_compile_options: ensure BEFORE keyword is handled in all scopes
Fixes: #20200
Diffstat (limited to 'Tests/RunCMake/target_compile_options/RunCMakeTest.cmake')
-rw-r--r-- | Tests/RunCMake/target_compile_options/RunCMakeTest.cmake | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Tests/RunCMake/target_compile_options/RunCMakeTest.cmake b/Tests/RunCMake/target_compile_options/RunCMakeTest.cmake index b67c598..9f51a9a 100644 --- a/Tests/RunCMake/target_compile_options/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_compile_options/RunCMakeTest.cmake @@ -1,3 +1,21 @@ include(RunCMake) run_cmake(empty_keyword_args) + +if (CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") + macro(run_cmake_target test subtest target) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build) + set(RunCMake_TEST_OUTPUT_MERGE 1) + set(RunCMake_TEST_NO_CLEAN 1) + run_cmake_command(${test}-${subtest} ${CMAKE_COMMAND} --build . --target ${target} ${ARGN}) + + unset(RunCMake_TEST_BINARY_DIR) + unset(RunCMake_TEST_OUTPUT_MERGE) + unset(RunCMake_TEST_NO_CLEAN) + endmacro() + + run_cmake(CMP0101-BEFORE_keyword) + + run_cmake_target(CMP0101-BEFORE_keyword OLD CMP0101_OLD) + run_cmake_target(CMP0101-BEFORE_keyword NEW CMP0101_NEW) +endif() |