diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2021-02-22 20:27:49 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2021-02-23 14:17:12 (GMT) |
commit | cf34011ce780254c2f649f6f7dffc619297333b8 (patch) | |
tree | c3dd94b37cfb34ab61c35b5ba7025cfc0b011212 /Tests/RunCMake/CMP0116 | |
parent | 3a9550351200e6bfbda993b0ec3064bddb894b69 (diff) | |
download | CMake-cf34011ce780254c2f649f6f7dffc619297333b8.zip CMake-cf34011ce780254c2f649f6f7dffc619297333b8.tar.gz CMake-cf34011ce780254c2f649f6f7dffc619297333b8.tar.bz2 |
Tests: Test per-CC behavior of CMP0116
Diffstat (limited to 'Tests/RunCMake/CMP0116')
-rw-r--r-- | Tests/RunCMake/CMP0116/CMP0116-Mixed-stderr.txt | 17 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0116/CMP0116-Mixed.cmake | 18 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0116/RunCMakeTest.cmake | 3 |
3 files changed, 38 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMP0116/CMP0116-Mixed-stderr.txt b/Tests/RunCMake/CMP0116/CMP0116-Mixed-stderr.txt new file mode 100644 index 0000000..10e83a9 --- /dev/null +++ b/Tests/RunCMake/CMP0116/CMP0116-Mixed-stderr.txt @@ -0,0 +1,17 @@ +^CMake Warning \(dev\) at CMP0116-Mixed\.cmake:1 \(add_custom_command\): + Policy CMP0116 is not set: Ninja generators transform DEPFILEs from + add_custom_command\(\)\. Run "cmake --help-policy CMP0116" for policy + details\. Use the cmake_policy command to set the policy and suppress this + warning\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\.( + +CMake Warning \(dev\) at CMP0116-Mixed\.cmake:1 \(add_custom_command\): + Policy CMP0116 is not set: Ninja generators transform DEPFILEs from + add_custom_command\(\)\. Run "cmake --help-policy CMP0116" for policy + details\. Use the cmake_policy command to set the policy and suppress this + warning\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\.)*$ diff --git a/Tests/RunCMake/CMP0116/CMP0116-Mixed.cmake b/Tests/RunCMake/CMP0116/CMP0116-Mixed.cmake new file mode 100644 index 0000000..6cbbc09 --- /dev/null +++ b/Tests/RunCMake/CMP0116/CMP0116-Mixed.cmake @@ -0,0 +1,18 @@ +add_custom_command( + OUTPUT warn.txt + COMMAND ${CMAKE_COMMAND} -E touch warn.txt + DEPFILE warn.d + ) +cmake_policy(SET CMP0116 OLD) +add_custom_command( + OUTPUT old.txt + COMMAND ${CMAKE_COMMAND} -E touch old.txt + DEPFILE old.d + ) +cmake_policy(SET CMP0116 NEW) +add_custom_command( + OUTPUT new.txt + COMMAND ${CMAKE_COMMAND} -E touch new.txt + DEPFILE new.d + ) +add_custom_target(cc ALL DEPENDS warn.txt old.txt new.txt) diff --git a/Tests/RunCMake/CMP0116/RunCMakeTest.cmake b/Tests/RunCMake/CMP0116/RunCMakeTest.cmake index 8a83cc1..ce3e86a 100644 --- a/Tests/RunCMake/CMP0116/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMP0116/RunCMakeTest.cmake @@ -47,3 +47,6 @@ run_cmp0116(NEW OFF) run_cmp0116(WARN ON) run_cmp0116(OLD ON) run_cmp0116(NEW ON) + +set(RunCMake_TEST_OPTIONS -DCMAKE_POLICY_WARNING_CMP0116:BOOL=TRUE) +run_cmake(CMP0116-Mixed) |