1
0
Fork 0

Don't enable LTCG in Debug on Windows.

This commit is contained in:
John Preston 2022-11-25 16:33:41 +01:00
parent 4a261d8c52
commit f5dab7d4b7
2 changed files with 11 additions and 3 deletions

View file

@ -40,9 +40,7 @@ function(init_target target_name) # init_target(my_target folder_name)
) )
endif() endif()
if (DESKTOP_APP_SPECIAL_TARGET AND WIN32 AND NOT build_win64) if (DESKTOP_APP_SPECIAL_TARGET AND WIN32 AND NOT build_win64)
target_compile_options(${target_name} PRIVATE /GL) set_property(TARGET ${target_name} APPEND_STRING PROPERTY STATIC_LIBRARY_OPTIONS "$<IF:$<CONFIG:Debug>,,/LTCG>")
target_link_options(${target_name} PRIVATE /LTCG)
set_property(TARGET ${target_name} APPEND_STRING PROPERTY STATIC_LIBRARY_OPTIONS "/LTCG")
endif() endif()
endfunction() endfunction()

View file

@ -53,6 +53,16 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
INTERFACE INTERFACE
/LARGEADDRESSAWARE # Allow more than 2 GB in 32 bit application. /LARGEADDRESSAWARE # Allow more than 2 GB in 32 bit application.
) )
if (DESKTOP_APP_SPECIAL_TARGET)
target_compile_options(common_options
INTERFACE
$<IF:$<CONFIG:Debug>,,/GL>
)
target_link_options(common_options
INTERFACE
$<IF:$<CONFIG:Debug>,,/LTCG>
)
endif()
endif() endif()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_definitions(common_options target_compile_definitions(common_options