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()