Use LTCG on Windows for two targets only.

This commit is contained in:
John Preston 2022-12-06 18:11:47 +04:00
parent 8937d732f6
commit a1faee285c
3 changed files with 20 additions and 1 deletions

View file

@ -1601,6 +1601,17 @@ if (WIN32)
/DELAYLOAD:wtsapi32.dll
/DELAYLOAD:propsys.dll
)
if (NOT build_win64 AND DESKTOP_APP_SPECIAL_TARGET)
target_compile_options(Telegram
PRIVATE
$<IF:$<CONFIG:Debug>,,/GL>
)
target_link_options(Telegram
PRIVATE
$<IF:$<CONFIG:Debug>,,/LTCG>
)
endif()
endif()
target_prepare_qrc(Telegram)

View file

@ -34,6 +34,14 @@ PUBLIC
desktop-app::lib_tl
)
if (WIN32 AND NOT build_win64 AND DESKTOP_APP_SPECIAL_TARGET)
target_compile_options(td_scheme
PRIVATE
$<IF:$<CONFIG:Debug>,,/GL>
)
set_property(TARGET td_scheme APPEND_STRING PROPERTY STATIC_LIBRARY_OPTIONS "$<IF:$<CONFIG:Debug>,,/LTCG>")
endif()
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "mips64")
# Sometimes final linking may fail with error "relocation truncated to fit"
# due to large scheme size.

2
cmake

@ -1 +1 @@
Subproject commit f5dab7d4b77ac1049cba9ae723c79ae6c391566f
Subproject commit 125b9571c58186d7190fb12a54a70493d4722627