diff options
author | Brad King <brad.king@kitware.com> | 2022-10-18 13:12:10 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-10-18 17:38:00 (GMT) |
commit | 50e90e282847f1109e5559d49fc12214b3493fff (patch) | |
tree | eb14171de7c42a755f0afab1b7db20b97dbf07fc /Tests/RunCMake/try_compile/CMP0128-NEW.cmake | |
parent | 367f10f4cbeb5d782e08a6e29ea5678fa4e71d14 (diff) | |
download | CMake-50e90e282847f1109e5559d49fc12214b3493fff.zip CMake-50e90e282847f1109e5559d49fc12214b3493fff.tar.gz CMake-50e90e282847f1109e5559d49fc12214b3493fff.tar.bz2 |
try_compile: Honor CMP0128 setting in test project
Some projects pass a raw `-std=` flag to the compiler in the
`try_compile` project. If they do not set CMP0128 to NEW,
we should not append a `-std=` flag where we did not before
the policy was added.
Fixes: #24063
Diffstat (limited to 'Tests/RunCMake/try_compile/CMP0128-NEW.cmake')
-rw-r--r-- | Tests/RunCMake/try_compile/CMP0128-NEW.cmake | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Tests/RunCMake/try_compile/CMP0128-NEW.cmake b/Tests/RunCMake/try_compile/CMP0128-NEW.cmake new file mode 100644 index 0000000..20e389a --- /dev/null +++ b/Tests/RunCMake/try_compile/CMP0128-NEW.cmake @@ -0,0 +1,7 @@ +cmake_policy(SET CMP0128 NEW) +set(check_cxx_std " +#if __cplusplus > 199711L && __cplusplus <= 201103L +# error Compiler is incorrectly in C++11 mode. +#endif +") +include(CMP0128-common.cmake) |