mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 13:20:47 -06:00
If a `CMakeLists.txt` or `CMAKE_TOOLCHAIN_FILE` sets a variable named `C`, `CXX`, or `CUDA`, we were previously comparing each enabled language name to the value of that variable, rather than the name itself. Double-quote the string to take advantage of policy `CMP0054`, but also add "x" prefixes to support projects that do not set the policy. Fixes: #22125
8 lines
271 B
CMake
8 lines
271 B
CMake
foreach(test_language C CXX)
|
|
enable_language(${test_language})
|
|
if(DEFINED CMAKE_${test_language}_STANDARD_DEFAULT
|
|
AND NOT CMAKE_${test_language}_COMPILE_FEATURES)
|
|
message(FATAL_ERROR "Compile features not found for ${test_language}")
|
|
endif()
|
|
endforeach()
|