Reduce file size by using IPO and LTO.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-12-31 13:56:36 +01:00
parent cab1b57a8e
commit 9d49b4839d
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 9 additions and 0 deletions

View File

@ -1,4 +1,6 @@
cmake_minimum_required(VERSION 3.13)
include(CheckIPOSupported)
project(pkmnLib)
# Enable all warnings, and make them error when occurring.
@ -102,6 +104,13 @@ file(GLOB_RECURSE CORE_SRC_FILES ${FILE_SOURCE})
add_library(pkmnLib ${LIBTYPE} ${CORE_SRC_FILES})
target_precompile_headers(pkmnLib 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 pkmnLib PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif ()
SET(_LINKS CreatureLib Arbutils)
SET(_TESTLINKS pkmnLib CreatureLib Arbutils)