mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-26 10:48:38 -06:00
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
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user