summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2018-07-31 15:35:17 -0700
committerGitHub <noreply@github.com>2018-07-31 15:35:17 -0700
commit9e3a4a2646533b5044b866a0c1932a1079a9c919 (patch)
tree179d28690eeab7aca98683eeb1c38f16ffa13d24
parent9bdd765a02de75851a00ab85223d5d582a104757 (diff)
downloadqtlocation-mapboxgl-9e3a4a2646533b5044b866a0c1932a1079a9c919.tar.gz
[ios, macos] Enable link-time optimization for iOS release builds (#12502)
-rw-r--r--cmake/loop-darwin.cmake2
-rw-r--r--cmake/mbgl.cmake3
-rw-r--r--cmake/offline.cmake2
-rw-r--r--platform/ios/ios.xcodeproj/project.pbxproj2
-rw-r--r--platform/macos/macos.xcodeproj/project.pbxproj1
5 files changed, 10 insertions, 0 deletions
diff --git a/cmake/loop-darwin.cmake b/cmake/loop-darwin.cmake
index 3109911e66..f60972902f 100644
--- a/cmake/loop-darwin.cmake
+++ b/cmake/loop-darwin.cmake
@@ -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) \ No newline at end of file
diff --git a/cmake/mbgl.cmake b/cmake/mbgl.cmake
index 7f2eaf86b0..338c2fd708 100644
--- a/cmake/mbgl.cmake
+++ b/cmake/mbgl.cmake
@@ -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.
diff --git a/cmake/offline.cmake b/cmake/offline.cmake
index d9dfb6c6e8..d1094c33c7 100644
--- a/cmake/offline.cmake
+++ b/cmake/offline.cmake
@@ -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(
diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj
index 6b883a3def..b77c67fbb3 100644
--- a/platform/ios/ios.xcodeproj/project.pbxproj
+++ b/platform/ios/ios.xcodeproj/project.pbxproj
@@ -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)",
diff --git a/platform/macos/macos.xcodeproj/project.pbxproj b/platform/macos/macos.xcodeproj/project.pbxproj
index 4cb436fdbf..ffb7b524c6 100644
--- a/platform/macos/macos.xcodeproj/project.pbxproj
+++ b/platform/macos/macos.xcodeproj/project.pbxproj
@@ -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)",