[ios, macos] Enable link-time optimization for iOS release builds (#12502)

This commit is contained in:
John Firebaugh
2018-07-31 15:35:17 -07:00
committed by GitHub
parent 9bdd765a02
commit 9e3a4a2646
5 changed files with 10 additions and 0 deletions

View File

@@ -13,4 +13,6 @@ create_source_groups(mbgl-loop-darwin)
set_target_properties(mbgl-loop-darwin PROPERTIES FOLDER "Core")
initialize_xcode_cxx_build_settings(mbgl-loop-darwin)
xcode_create_scheme(TARGET mbgl-loop-darwin)

View File

@@ -203,6 +203,9 @@ macro(initialize_xcode_cxx_build_settings target)
# -Wrange-loop-analysis
set_xcode_property(${target} CLANG_WARN_RANGE_LOOP_ANALYSIS YES)
# -flto
set_xcode_property(${target} LLVM_LTO $<$<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebugInfo>>:YES>)
endmacro(initialize_xcode_cxx_build_settings)
# CMake 3.1 does not have this yet.

View File

@@ -21,6 +21,8 @@ mbgl_platform_offline()
create_source_groups(mbgl-offline)
initialize_xcode_cxx_build_settings(mbgl-offline)
set_target_properties(mbgl-offline PROPERTIES FOLDER "Executables")
xcode_create_scheme(

View File

@@ -3793,6 +3793,7 @@
INFOPLIST_FILE = framework/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LLVM_LTO = YES;
OTHER_CFLAGS = "-fvisibility=hidden";
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
@@ -3878,6 +3879,7 @@
"$(mbgl_core_INCLUDE_DIRECTORIES)",
"$(mbgl_filesource_LINK_LIBRARIES)",
);
LLVM_LTO = YES;
OTHER_CFLAGS = "-fvisibility=hidden";
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",

View File

@@ -2004,6 +2004,7 @@
INFOPLIST_FILE = "$(SRCROOT)/sdk/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
LLVM_LTO = YES;
OTHER_CFLAGS = "-fvisibility=hidden";
OTHER_LDFLAGS = (
"$(mbgl_core_LINK_LIBRARIES)",