Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Unified Diff: build/config/ios/ios_sdk.gni

Issue 2123253004: Add support for multi-architecture application bundle on iOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment on how to use additional_target_cpus variable Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/config/ios/rules.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/ios/ios_sdk.gni
diff --git a/build/config/ios/ios_sdk.gni b/build/config/ios/ios_sdk.gni
index 31885e77c282b0796950cd7896f386c72233b478..e3abd7bc0f1a69aa8ff0787ae4bb4daf867b508b 100644
--- a/build/config/ios/ios_sdk.gni
+++ b/build/config/ios/ios_sdk.gni
@@ -23,6 +23,43 @@ declare_args() {
# ios_enable_code_signing_flag=<bool> flag to make the invocation clearer.
ios_enable_code_signing = true
ios_code_signing_identity = ""
+
+ # If non-empty, this list must contain valid cpu architecture, and the final
+ # build will be a multi-architecture build (aka fat build) supporting the
+ # main $target_cpu architecture and all of $additional_target_cpus.
+ #
+ # For example to build an application that will run on both arm64 and armv7
+ # devices, you would use the following in args.gn file when running "gn args":
+ #
+ # target_os = "ios"
+ # target_cpu = "arm64"
+ # additional_target_cpus = [ "arm" ]
+ #
+ # You can also pass the value via "--args" parameter for "gn gen" command by
+ # using the syntax --args='additional_target_cpus=["arm"] target_cpu="arm64"'.
+ additional_target_cpus = []
+}
+
+assert(custom_toolchain == "" || additional_target_cpus == [],
+ "cannot define both custom_toolchain and additional_target_cpus")
+
+# Initialize additional_toolchains from additional_target_cpus. Assert here
+# that the list does not contains $target_cpu nor duplicates as this would
+# cause weird errors during the build.
+additional_toolchains = []
+if (additional_target_cpus != []) {
+ foreach(_additional_target_cpu, additional_target_cpus) {
+ assert(_additional_target_cpu != target_cpu,
+ "target_cpu must not be listed in additional_target_cpus")
+
+ _toolchain = "//build/toolchain/mac:ios_clang_$_additional_target_cpu"
+ foreach(_additional_toolchain, additional_toolchains) {
+ assert(_toolchain != _additional_toolchain,
+ "additional_target_cpus must not contains duplicate values")
+ }
+
+ additional_toolchains += [ _toolchain ]
+ }
}
if (ios_sdk_path == "") {
« no previous file with comments | « no previous file | build/config/ios/rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698