Skip to content

Commit

Permalink
Enable LTO by Xcode project settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Nov 29, 2019
1 parent ff82101 commit 60f9cc6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions init_target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 $<IF:$<CONFIG:Debug>,0,fast>
XCODE_ATTRIBUTE_LLVM_LTO $<IF:$<CONFIG:Debug>,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()

0 comments on commit 60f9cc6

Please sign in to comment.