CompilerId/Features: Tolerate variables named for languages
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
Showing
- Modules/CMakeCompilerIdDetection.cmake 1 addition, 1 deletionModules/CMakeCompilerIdDetection.cmake
- Modules/CMakeDetermineCompileFeatures.cmake 3 additions, 3 deletionsModules/CMakeDetermineCompileFeatures.cmake
- Tests/RunCMake/ToolchainFile/LangVars-toolchain.cmake 2 additions, 0 deletionsTests/RunCMake/ToolchainFile/LangVars-toolchain.cmake
- Tests/RunCMake/ToolchainFile/LangVars.cmake 7 additions, 0 deletionsTests/RunCMake/ToolchainFile/LangVars.cmake
- Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake 1 addition, 0 deletionsTests/RunCMake/ToolchainFile/RunCMakeTest.cmake
Loading
Please register or sign in to comment