mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 08:20:18 -06:00
CheckIPOSupported: Simplify result reporting logic
Simplify the test for whether a `RESULT` argument was given to the `check_ipo_supported` call. Also do not set an empty variable name if `OUTPUT` was not given.
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
|
||||
|
||||
Reference in New Issue
Block a user