mirror of https://github.com/OpenRCT2/OpenRCT2.git
Make build type check case insensitive
This commit is contained in:
parent
9186c8b7d9
commit
b1bc3d9322
|
@ -53,7 +53,7 @@ if (PORTABLE OR WIN32)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
include(cmake/ipo.cmake)
|
include(cmake/ipo.cmake)
|
||||||
list(APPEND IPO_ENABLED_BUILDS Release RelWithDebInfo MinSizeRel)
|
list(APPEND IPO_ENABLED_BUILDS RELEASE RELWITHDEBINFO MINSIZEREL)
|
||||||
ipo_enable("${IPO_ENABLED_BUILDS}")
|
ipo_enable("${IPO_ENABLED_BUILDS}")
|
||||||
|
|
||||||
# Describe current version in terms of closest tag
|
# Describe current version in terms of closest tag
|
||||||
|
|
|
@ -4,21 +4,23 @@ option(DISABLE_IPO "Disable IPO in supported release builds." OFF)
|
||||||
|
|
||||||
# Enabled IPO for a LIST of CMake build types.
|
# Enabled IPO for a LIST of CMake build types.
|
||||||
# Provides IPO_BUILD_ENABLED to the parent scope.
|
# Provides IPO_BUILD_ENABLED to the parent scope.
|
||||||
|
# Make sure to supply the build types in UPPER CASE
|
||||||
function(ipo_enable IPO_ENABLED_BUILDS)
|
function(ipo_enable IPO_ENABLED_BUILDS)
|
||||||
include(CheckIPOSupported)
|
include(CheckIPOSupported)
|
||||||
check_ipo_supported(RESULT IPO_SUPPORTED OUTPUT IPO_LOG)
|
check_ipo_supported(RESULT IPO_SUPPORTED OUTPUT IPO_LOG)
|
||||||
|
|
||||||
set(IPO_BUILD_ENABLED OFF PARENT_SCOPE)
|
set(IPO_BUILD_ENABLED OFF PARENT_SCOPE)
|
||||||
|
string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_UPPER)
|
||||||
if(NOT CMAKE_BUILD_TYPE)
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
message(STATUS "CMAKE_BUILD_TYPE not explicitly set. Not enabling IPO.")
|
message(STATUS "CMAKE_BUILD_TYPE not explicitly set. Not enabling IPO.")
|
||||||
elseif(IPO_SUPPORTED AND ${CMAKE_BUILD_TYPE} IN_LIST IPO_ENABLED_BUILDS)
|
elseif(IPO_SUPPORTED AND ${CMAKE_BUILD_TYPE_UPPER} IN_LIST IPO_ENABLED_BUILDS)
|
||||||
if(NOT DISABLE_IPO)
|
if(NOT DISABLE_IPO)
|
||||||
message(STATUS "IPO supported and enabled in ${CMAKE_BUILD_TYPE}.")
|
message(STATUS "IPO supported and enabled in ${CMAKE_BUILD_TYPE}.")
|
||||||
set(IPO_BUILD_ENABLED ON PARENT_SCOPE)
|
set(IPO_BUILD_ENABLED ON PARENT_SCOPE)
|
||||||
else()
|
else()
|
||||||
message(STATUS "IPO explicitly disabled.")
|
message(STATUS "IPO explicitly disabled.")
|
||||||
endif()
|
endif()
|
||||||
elseif(NOT IPO_SUPPORTED AND ${CMAKE_BUILD_TYPE} IN_LIST IPO_ENABLED_BUILDS)
|
elseif(NOT IPO_SUPPORTED AND ${CMAKE_BUILD_TYPE_UPPER} IN_LIST IPO_ENABLED_BUILDS)
|
||||||
message(STATUS "IPO not supported: ${IPO_LOG}.")
|
message(STATUS "IPO not supported: ${IPO_LOG}.")
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
Loading…
Reference in New Issue