summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-08-30 11:53:40 -0400
committerBrad King <brad.king@kitware.com>2018-08-30 11:53:40 -0400
commit80bb9214dd6bac5c0d2e8eea04d111ee419a89fe (patch)
treea52a40feaad5ffc32c77fcfd8b0a5e33489f10ba
parent0e764082fe5f9d9c0e33244412f0d4a519e4a2e6 (diff)
parent4e1ea02bb86f40d8ba0c247869a508b1da2c84b1 (diff)
downloadcmake-80bb9214dd6bac5c0d2e8eea04d111ee419a89fe.tar.gz
Merge branch 'CheckIPOSupported-output-backslashes' into release-3.12
Merge-request: !2331
-rw-r--r--Modules/CheckIPOSupported.cmake15
1 files changed, 11 insertions, 4 deletions
diff --git a/Modules/CheckIPOSupported.cmake b/Modules/CheckIPOSupported.cmake
index d8297d91cf..3344834cd4 100644
--- a/Modules/CheckIPOSupported.cmake
+++ b/Modules/CheckIPOSupported.cmake
@@ -56,13 +56,14 @@ include(CMakeParseArguments) # cmake_parse_arguments
# X_RESULT - name of the final result variable
# X_OUTPUT - name of the variable with information about error
macro(_ipo_not_supported output)
- string(COMPARE EQUAL "${X_RESULT}" "" is_empty)
- if(is_empty)
+ if(NOT X_RESULT)
message(FATAL_ERROR "IPO is not supported (${output}).")
endif()
set("${X_RESULT}" NO PARENT_SCOPE)
- set("${X_OUTPUT}" "${output}" PARENT_SCOPE)
+ if(X_OUTPUT)
+ set("${X_OUTPUT}" "${output}" PARENT_SCOPE)
+ endif()
endmacro()
# Run IPO/LTO test
@@ -125,7 +126,13 @@ macro(_ipo_run_language_check language)
)
if(NOT result)
- _ipo_not_supported("${output}")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "${language} compiler IPO check failed with the following output:\n"
+ "${output}\n")
+ _ipo_not_supported("check failed to compile")
+ if(X_OUTPUT)
+ set("${X_OUTPUT}" "${output}" PARENT_SCOPE)
+ endif()
return()
endif()
endmacro()