mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 14:53:52 +00:00
Enable CMake Release build type and LTO by default
This commit is contained in:
@@ -5,6 +5,22 @@ SET(EXECNAME "AerofoilX" CACHE STRING "Defines the exec name")
|
|||||||
|
|
||||||
message(${CMAKE_BINARY_DIR})
|
message(${CMAKE_BINARY_DIR})
|
||||||
|
|
||||||
|
# Use Release build type by default
|
||||||
|
if("${CMAKE_BUILD_TYPE}" STREQUAL "")
|
||||||
|
set(CMAKE_BUILD_TYPE Release)
|
||||||
|
message("Build type unspecified, using Release")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Enable LTO by default if supported
|
||||||
|
if("${CMAKE_INTERPROCEDURAL_OPTIMIZATION}" STREQUAL "")
|
||||||
|
include(CheckIPOSupported)
|
||||||
|
check_ipo_supported(RESULT IPO_SUPPORTED)
|
||||||
|
if(IPO_SUPPORTED)
|
||||||
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION On)
|
||||||
|
message("Compiler supports LTO, enabling automatically")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
find_package(SDL2 REQUIRED)
|
find_package(SDL2 REQUIRED)
|
||||||
|
|
||||||
if(PLATFORM STREQUAL "MAC")
|
if(PLATFORM STREQUAL "MAC")
|
||||||
|
Reference in New Issue
Block a user