summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/target_compile_options/RunCMakeTest.cmake
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2020-01-10 18:13:09 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2020-01-11 00:25:25 (GMT)
commit2678e310537a965b531cfc2c1f54fc72aac9d7d5 (patch)
tree6eaba42609646e732b70a71302095b87853d543e /Tests/RunCMake/target_compile_options/RunCMakeTest.cmake
parent3795dea6f1d4ca9bc1a2131173ed190f6c362fbe (diff)
downloadCMake-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.cmake18
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()