mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Add option to enable LTCG
CMake option for link-time code generation.
This commit is contained in:
parent
2ca1a290e2
commit
89b92342d7
@ -21,6 +21,7 @@ macro( apply_project_settings )
|
|||||||
|
|
||||||
# Some thirdparty code have Warnings as Errors disabled; this option won't override those.
|
# Some thirdparty code have Warnings as Errors disabled; this option won't override those.
|
||||||
option( GLOBAL_WARNINGS_AS_ERRORS "Treat compiler warnings as errors" ON )
|
option( GLOBAL_WARNINGS_AS_ERRORS "Treat compiler warnings as errors" ON )
|
||||||
|
option( ENABLE_LTCG "Enable link-time code generation (significantly increases compile times)" OFF )
|
||||||
|
|
||||||
set( GAMEDLL_OPTION "GAMEDLL_S3" CACHE STRING "Game DLL version" )
|
set( GAMEDLL_OPTION "GAMEDLL_S3" CACHE STRING "Game DLL version" )
|
||||||
set_property( CACHE GAMEDLL_OPTION PROPERTY STRINGS
|
set_property( CACHE GAMEDLL_OPTION PROPERTY STRINGS
|
||||||
@ -60,6 +61,13 @@ macro( apply_project_settings )
|
|||||||
$<$<AND:$<CXX_COMPILER_ID:MSVC>,$<CONFIG:Release>>:/EHsc>
|
$<$<AND:$<CXX_COMPILER_ID:MSVC>,$<CONFIG:Release>>:/EHsc>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if( ${ENABLE_LTCG} )
|
||||||
|
add_compile_options(
|
||||||
|
$<$<AND:$<CXX_COMPILER_ID:MSVC>,$<CONFIG:Profile>>:/GL>
|
||||||
|
$<$<AND:$<CXX_COMPILER_ID:MSVC>,$<CONFIG:Release>>:/GL>
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
set( CMAKE_EXE_LINKER_FLAGS_RELEASE
|
set( CMAKE_EXE_LINKER_FLAGS_RELEASE
|
||||||
"${CMAKE_EXE_LINKER_FLAGS_RELEASE}
|
"${CMAKE_EXE_LINKER_FLAGS_RELEASE}
|
||||||
/OPT:REF
|
/OPT:REF
|
||||||
|
Loading…
x
Reference in New Issue
Block a user