From 60f9cc611aad098ab0d3769ae1bb84061ac4663f Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 29 Nov 2019 17:52:44 +0300 Subject: [PATCH] Enable LTO by Xcode project settings. --- init_target.cmake | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/init_target.cmake b/init_target.cmake index ce11a415..23023c53 100644 --- a/init_target.cmake +++ b/init_target.cmake @@ -27,13 +27,18 @@ function(init_target target_name) # init_target(my_target folder_name) endif() target_link_libraries(${target_name} PUBLIC desktop-app::common_options) set_target_properties(${target_name} PROPERTIES - INTERPROCEDURAL_OPTIMIZATION_RELEASE True - INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO True - INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL True LINK_SEARCH_START_STATIC 1 XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_WEAK YES XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN YES XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN YES + XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL $,0,fast> + XCODE_ATTRIBUTE_LLVM_LTO $,NO,YES> ) + if (NOT APPLE) + set_target_properties(${target_name} PROPERTIES + INTERPROCEDURAL_OPTIMIZATION_RELEASE True + INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO True + INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL True + ) + endif() endfunction() -