enable_language: Fix test for working compiler with CMP0126 NEW behavior
Update the logic that converts a `try_compile` result from a cache entry to a normal variable to tolerate an existing normal variable under CMP0126 NEW behavior. Otherwise the `try_compile` result is ignored because CMake uses the false value of the normal variable, and CMake incorrectly reports that the compiler does not work. This went unnoticed for some languages (e.g. C and CXX) because the check for a working compiler is skipped if ABI detection works. It does affect other languages (e.g. CSharp). Fixes: #22423
Showing
- Modules/CMakeTestCCompiler.cmake 3 additions, 0 deletionsModules/CMakeTestCCompiler.cmake
- Modules/CMakeTestCSharpCompiler.cmake 3 additions, 0 deletionsModules/CMakeTestCSharpCompiler.cmake
- Modules/CMakeTestCUDACompiler.cmake 4 additions, 0 deletionsModules/CMakeTestCUDACompiler.cmake
- Modules/CMakeTestCXXCompiler.cmake 3 additions, 0 deletionsModules/CMakeTestCXXCompiler.cmake
- Modules/CMakeTestFortranCompiler.cmake 3 additions, 0 deletionsModules/CMakeTestFortranCompiler.cmake
- Modules/CMakeTestHIPCompiler.cmake 3 additions, 0 deletionsModules/CMakeTestHIPCompiler.cmake
- Modules/CMakeTestOBJCCompiler.cmake 3 additions, 0 deletionsModules/CMakeTestOBJCCompiler.cmake
- Modules/CMakeTestOBJCXXCompiler.cmake 3 additions, 0 deletionsModules/CMakeTestOBJCXXCompiler.cmake
- Modules/CMakeTestSwiftCompiler.cmake 3 additions, 0 deletionsModules/CMakeTestSwiftCompiler.cmake
- Tests/CSharpOnly/CMakeLists.txt 3 additions, 0 deletionsTests/CSharpOnly/CMakeLists.txt
Loading
Please register or sign in to comment