[ios, macos] Enable link-time optimization for iOS release builds (#12502)
This commit is contained in:
@@ -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)
|
||||
@@ -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.
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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)",
|
||||
|
||||
@@ -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)",
|
||||
|
||||
Reference in New Issue
Block a user