Reduce file size by using IPO and LTO.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
parent
207d4bd799
commit
941927336e
|
@ -1,4 +1,6 @@
|
|||
cmake_minimum_required(VERSION 3.16)
|
||||
include(CheckIPOSupported)
|
||||
|
||||
project(CreatureLib)
|
||||
|
||||
# Enable all warnings, and make them error when occurring.
|
||||
|
@ -59,6 +61,13 @@ file(GLOB_RECURSE LIBRARY_SRC_FILES
|
|||
add_library(CreatureLib SHARED ${LIBRARY_SRC_FILES})
|
||||
target_precompile_headers(CreatureLib PUBLIC src/Precompiled.hxx)
|
||||
|
||||
# If interprocedural optimization is available, apply it
|
||||
check_ipo_supported(RESULT IPO_SUPPORTED)
|
||||
if (IPO_SUPPORTED)
|
||||
message(STATUS "IPO / LTO enabled")
|
||||
set_property(TARGET CreatureLib PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
|
||||
endif ()
|
||||
|
||||
# If we are building for Windows we need to set some specific variables.
|
||||
if (WINDOWS)
|
||||
MESSAGE(WARNING, "Using Windows Build.")
|
||||
|
|
Loading…
Reference in New Issue