summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-01-16 11:28:03 -0500
committerBrad King <brad.king@kitware.com>2023-01-18 16:41:00 -0500
commit919944968785e0f86d937cc251abfdb965f946be (patch)
tree949607eba9d2cfd577bcc83040a290988aa4e147
parent24ccc8c3c95e25bcd9991f0dca02c084ae56bc76 (diff)
downloadcmake-919944968785e0f86d937cc251abfdb965f946be.tar.gz
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.cmake11
1 files changed, 7 insertions, 4 deletions
diff --git a/Modules/Internal/FeatureTesting.cmake b/Modules/Internal/FeatureTesting.cmake
index 5c144ec517..06cc8237bf 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()