1
0
Fork 0

Inherit per-config INTERPROCEDURAL_OPTIMIZATION options

This also fixes the missing -fno-use-linker-plugin in Debug configuration with DESKTOP_APP_SPECIAL_TARGET since the last change
This commit is contained in:
Ilya Fedin 2022-11-15 00:25:02 +04:00 committed by John Preston
parent 5723b4f274
commit d41ce7f553

View file

@ -63,19 +63,11 @@ if (NOT DESKTOP_APP_USE_PACKAGED)
-nostdlib++ -nostdlib++
) )
endif() endif()
if (CMAKE_INTERPROCEDURAL_OPTIMIZATION) set(interprocedural_optimization_config $<TARGET_PROPERTY:INTERPROCEDURAL_OPTIMIZATION_$<UPPER_CASE:$<CONFIG>>>)
target_link_options(common_options set(interprocedural_optimization_values -fwhole-program,$<IF:$<BOOL:{DESKTOP_APP_SPECIAL_TARGET}>,$<$<CONFIG:Debug>:-fno-use-linker-plugin>,-fno-use-linker-plugin>)
INTERFACE
-fwhole-program
)
elseif (NOT DESKTOP_APP_SPECIAL_TARGET)
target_link_options(common_options
INTERFACE
-fno-use-linker-plugin
)
endif()
target_link_options(common_options target_link_options(common_options
INTERFACE INTERFACE
$<IF:$<NOT:$<STREQUAL:${interprocedural_optimization_config},>>,$<IF:$<BOOL:${interprocedural_optimization_config}>,${interprocedural_optimization_values}>,$<IF:$<BOOL:$<TARGET_PROPERTY:INTERPROCEDURAL_OPTIMIZATION>>,${interprocedural_optimization_values}>>
-rdynamic -rdynamic
) )
endif() endif()