mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-07 22:30:13 -06:00
Merge topic 'CheckIPOSupported-output-backslashes'
4e1ea02bb8CheckIPOSupported: Tolerate backslashes in output of failed checksb7dbb25a0aCheckIPOSupported: Simplify result reporting logic Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2331
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user