diff options
author | Brad King <brad.king@kitware.com> | 2023-01-16 16:28:03 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-01-18 21:41:00 (GMT) |
commit | 919944968785e0f86d937cc251abfdb965f946be (patch) | |
tree | 949607eba9d2cfd577bcc83040a290988aa4e147 | |
parent | 24ccc8c3c95e25bcd9991f0dca02c084ae56bc76 (diff) | |
download | CMake-919944968785e0f86d937cc251abfdb965f946be.zip CMake-919944968785e0f86d937cc251abfdb965f946be.tar.gz CMake-919944968785e0f86d937cc251abfdb965f946be.tar.bz2 |
CompileFeatures: Warn explicitly when feature detection binary is not found
This step is not normally expected to fail, so warn instead of logging it.
-rw-r--r-- | Modules/Internal/FeatureTesting.cmake | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Modules/Internal/FeatureTesting.cmake b/Modules/Internal/FeatureTesting.cmake index 5c144ec..06cc823 100644 --- a/Modules/Internal/FeatureTesting.cmake +++ b/Modules/Internal/FeatureTesting.cmake @@ -39,10 +39,13 @@ macro(_record_compiler_features lang compile_flags feature_list) COPY_FILE "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.bin" COPY_FILE_ERROR _copy_error ) - if(CMAKE_${lang}_FEATURE_TEST AND NOT _copy_error) - set(_result 0) - else() + if(NOT CMAKE_${lang}_FEATURE_TEST) + set(_result 255) + elseif(_copy_error) set(_result 255) + message(WARNING "${_copy_error}") + else() + set(_result 0) endif() unset(CMAKE_${lang}_FEATURE_TEST CACHE) unset(compile_flags_for_link) @@ -66,7 +69,7 @@ macro(_record_compiler_features lang compile_flags feature_list) endif() else() file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Detecting ${lang} [${compile_flags}] compiler features failed to compile with the following output:\n${_output}\n${_copy_error}\n\n") + "Detecting ${lang} [${compile_flags}] compiler features failed to compile with the following output:\n${_output}\n\n") endif() endmacro() |