diff options
author | Brad King <brad.king@kitware.com> | 2021-08-18 19:24:30 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-08-18 19:25:49 (GMT) |
commit | 89ed11ae6f98319bbba2c34e7c0e1d1a5c8dd547 (patch) | |
tree | 9d3f6b884c51f31ce5a0aa2b56e5211180d590bb /Modules | |
parent | 3de5096094b440b75887467a79e04eaafb2ba236 (diff) | |
download | CMake-89ed11ae6f98319bbba2c34e7c0e1d1a5c8dd547.zip CMake-89ed11ae6f98319bbba2c34e7c0e1d1a5c8dd547.tar.gz CMake-89ed11ae6f98319bbba2c34e7c0e1d1a5c8dd547.tar.bz2 |
CheckLanguage: Avoid CMP0126 warning
The macro's implementation converts a normal variable into a cache
variable intentionally, so both are set. Explicitly set CMP0126 to NEW
to avoid a warning in trace mode. This won't affect the module behavior
because the code path does not activate if a normal variable is already
defined anyway.
Fixes: #22548
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CheckLanguage.cmake | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/CheckLanguage.cmake b/Modules/CheckLanguage.cmake index 928881c..559c103 100644 --- a/Modules/CheckLanguage.cmake +++ b/Modules/CheckLanguage.cmake @@ -36,6 +36,9 @@ Example: include_guard(GLOBAL) +cmake_policy(PUSH) +cmake_policy(SET CMP0126 NEW) + macro(check_language lang) if(NOT DEFINED CMAKE_${lang}_COMPILER) set(_desc "Looking for a ${lang} compiler") @@ -110,3 +113,5 @@ file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\" endif() endmacro() + +cmake_policy(POP) |