From 919944968785e0f86d937cc251abfdb965f946be Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 16 Jan 2023 11:28:03 -0500 Subject: CompileFeatures: Warn explicitly when feature detection binary is not found This step is not normally expected to fail, so warn instead of logging it. --- Modules/Internal/FeatureTesting.cmake | 11 +++++++---- 1 file 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() -- cgit v0.12