Check for unset CMAKE_BUILD_TYPE

This commit is contained in:
Tom Lankhorst committed 2019-01-27 13:23:36 +01:00
1 parent 0789ef541d
commit 9186c8b7d9
1 file changed
+3 -1
+3 -1
View File
@@ -9,7 +9,9 @@ function(ipo_enable IPO_ENABLED_BUILDS)
check_ipo_supported(RESULT IPO_SUPPORTED OUTPUT IPO_LOG)
set(IPO_BUILD_ENABLED OFF PARENT_SCOPE)
if(IPO_SUPPORTED AND ${CMAKE_BUILD_TYPE} IN_LIST IPO_ENABLED_BUILDS)
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "CMAKE_BUILD_TYPE not explicitly set. Not enabling IPO.")
elseif(IPO_SUPPORTED AND ${CMAKE_BUILD_TYPE} IN_LIST IPO_ENABLED_BUILDS)
if(NOT DISABLE_IPO)
message(STATUS "IPO supported and enabled in ${CMAKE_BUILD_TYPE}.")
set(IPO_BUILD_ENABLED ON PARENT_SCOPE)