summaryrefslogtreecommitdiff
path: root/Modules/CheckIPOSupported.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-08-30 11:21:34 -0400
committerBrad King <brad.king@kitware.com>2018-08-30 11:45:13 -0400
commitb7dbb25a0a18187e85e6def956bc5516a3284b90 (patch)
treede3e0842e5fe96c0dac0160732490d0ae8c4806c /Modules/CheckIPOSupported.cmake
parentc4ab098097f4fe1bc85ee29c6de390dff435f63f (diff)
downloadcmake-b7dbb25a0a18187e85e6def956bc5516a3284b90.tar.gz
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.
Diffstat (limited to 'Modules/CheckIPOSupported.cmake')
-rw-r--r--Modules/CheckIPOSupported.cmake7
1 files changed, 4 insertions, 3 deletions
diff --git a/Modules/CheckIPOSupported.cmake b/Modules/CheckIPOSupported.cmake
index d8297d91cf..de2a1404e3 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