mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2025-06-03 00:00:20 +00:00
[cmake] enforce a supported build type
We check for build types internally to enable/disable debug options. Ensure the CMAKE_BUILD_TYPE is either not set or set to a supported value.
This commit is contained in:
parent
ae5f655f12
commit
0d7edfd884
@ -29,6 +29,8 @@ if (NOT ANDROID)
|
|||||||
option(CMAKE_INTERPROCEDURAL_OPTIMIZATION "build with link time optimization" ${supported})
|
option(CMAKE_INTERPROCEDURAL_OPTIMIZATION "build with link time optimization" ${supported})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(SUPPORTED_BUILD_TYPES "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
||||||
|
|
||||||
# Default to release build type
|
# Default to release build type
|
||||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
# Set a default build type if none was specified
|
# Set a default build type if none was specified
|
||||||
@ -39,7 +41,13 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
|||||||
STRING "Choose the type of build." FORCE)
|
STRING "Choose the type of build." FORCE)
|
||||||
# Set the possible values of build type for cmake-gui
|
# Set the possible values of build type for cmake-gui
|
||||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
|
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
|
||||||
STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
STRINGS ${SUPPORTED_BUILD_TYPES})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (CMAKE_BUILD_TYPE)
|
||||||
|
if (NOT "${CMAKE_BUILD_TYPE}" IN_LIST SUPPORTED_BUILD_TYPES)
|
||||||
|
message(FATAL_ERROR "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} not supported. Set to any of ${SUPPORTED_BUILD_TYPES}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(PlatformDefaults)
|
include(PlatformDefaults)
|
||||||
|
Loading…
Reference in New Issue
Block a user