mirror of
https://git.planet-casio.com/Lephenixnoir/JustUI.git
synced 2024-12-29 13:03:40 +01:00
enable LTO
This commit is contained in:
parent
5b092a5a4e
commit
5a885b541f
1 changed files with 7 additions and 1 deletions
|
@ -40,13 +40,19 @@ add_library(${NAME} STATIC
|
||||||
)
|
)
|
||||||
|
|
||||||
target_compile_options(${NAME} PUBLIC
|
target_compile_options(${NAME} PUBLIC
|
||||||
-Wall -Wextra -std=c11 -Os)
|
-Wall -Wextra -std=c11 -Os -flto)
|
||||||
target_include_directories(${NAME} PUBLIC
|
target_include_directories(${NAME} PUBLIC
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/include"
|
"${CMAKE_CURRENT_SOURCE_DIR}/include"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/include")
|
"${CMAKE_CURRENT_BINARY_DIR}/include")
|
||||||
target_link_libraries(${NAME}
|
target_link_libraries(${NAME}
|
||||||
Gint::Gint -lm)
|
Gint::Gint -lm)
|
||||||
|
|
||||||
|
# Generate the archive with gcc-ar instead of ar as it will load the LTO plugin
|
||||||
|
# which is required to generate a usable archive.
|
||||||
|
set(CMAKE_C_ARCHIVE_CREATE "${CMAKE_C_COMPILER_AR} qcs <TARGET> <OBJECTS>")
|
||||||
|
# Also the ranlib rule (useless because ar is passed the s flag anyway)
|
||||||
|
set(CMAKE_C_ARCHIVE_FINISH "${CMAKE_C_COMPILER_RANLIB} <TARGET>")
|
||||||
|
|
||||||
install(TARGETS ${NAME}
|
install(TARGETS ${NAME}
|
||||||
DESTINATION "${FXSDK_LIB}")
|
DESTINATION "${FXSDK_LIB}")
|
||||||
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/"
|
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/"
|
||||||
|
|
Loading…
Reference in a new issue