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

Unified Diff: build/config/ios/BUILD.gn

Issue 2631573002: Support building libs and apps for iOS, watchOS, and tvOS with bitcode (Closed)
Patch Set: Support building libs and apps for iOS, watchOS, and tvOS with bitcode. Created 3 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/ios/BUILD.gn
diff --git a/build/config/ios/BUILD.gn b/build/config/ios/BUILD.gn
index 0dda3e52631cc9f627d1e9519501859bafa6a7a2..ec6b9e67bcfb5f1fa5a7acb1495f5d4e6d7d8ac7 100644
--- a/build/config/ios/BUILD.gn
+++ b/build/config/ios/BUILD.gn
@@ -6,6 +6,23 @@ import("//build/config/ios/ios_sdk.gni")
import("//build/config/sysroot.gni")
import("//build/toolchain/toolchain.gni")
+declare_args() {
+ # Enabling this option makes clang compile to an intermediate
+ # representation ("bitcode"), and not to native code. This is preferred
+ # when including WebRTC in the apps that will be sent to Apple's App Store
+ # and mandatory for the apps that run on watchOS or tvOS.
+ # The option only works when building with Xcode (use_xcode_clang = true).
+ # Mimicking how Xcode handles it, the production builds (is_debug = false)
+ # get real bitcode sections added, while the debug builds (is_debug = true)
+ # only get bitcode-section "markers" added in them.
+ # NOTE: This option is ignored when building versions for the iOS simulator,
+ # where a part of libvpx is compiled from the assembly code written using
+ # Intel assembly syntax; Yasm / Nasm do not support emitting bitcode parts.
+ # That is not a limitation for now as Xcode mandates the presence of bitcode
+ # only when building bitcode-enabled projects for real devices (ARM CPUs).
+ enable_ios_bitcode = false
+}
+
# This is included by reference in the //build/config/compiler:runtime_library
# config that is applied to all targets. It is here to separate out the logic
# that is iOS-only. Please see that target for advice on what should go in
@@ -24,6 +41,14 @@ config("runtime_library") {
common_flags += [ "-miphoneos-version-min=$ios_deployment_target" ]
}
+ if (use_xcode_clang && enable_ios_bitcode && !use_ios_simulator) {
+ if (is_debug) {
+ common_flags += [ "-fembed-bitcode-marker" ]
+ } else {
+ common_flags += [ "-fembed-bitcode" ]
+ }
+ }
+
asmflags = common_flags
cflags = common_flags
ldflags = common_flags
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698