From 592baaf89aaf79245a55bfd3dbf47371b486cd03 Mon Sep 17 00:00:00 2001 From: kthelgason Date: Wed, 9 Nov 2016 04:58:12 -0800 Subject: [PATCH] Add build flag to enable bitcode on ios BUG=webrtc:5085 NOTRY=true Review-Url: https://codereview.webrtc.org/2478663002 Cr-Commit-Position: refs/heads/master@{#14997} --- webrtc/build/ios/BUILD.gn | 24 ++++++++++++++++++++++++ webrtc/build/webrtc.gni | 8 ++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 webrtc/build/ios/BUILD.gn diff --git a/webrtc/build/ios/BUILD.gn b/webrtc/build/ios/BUILD.gn new file mode 100644 index 0000000000..219617cb17 --- /dev/null +++ b/webrtc/build/ios/BUILD.gn @@ -0,0 +1,24 @@ +# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. +# +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file in the root of the source +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. + +# This file is only meant to be included on iOS. +assert(is_ios) + +declare_args() { + # Enabling this option makes clang compile to an intermediate + # representation, and not to native code. This is preferred when + # including WebRTC in apps that will be sent to Apple's App Store + # and required for apps that run on watchOS or tvOS. + rtc_ios_enable_bitcode = false +} + +config("rtc_ios_common_config") { + if (rtc_ios_enable_bitcode) { + cflags = [ "-fembed-bitcode" ] + } +} diff --git a/webrtc/build/webrtc.gni b/webrtc/build/webrtc.gni index e6cf3387a6..2198792cef 100644 --- a/webrtc/build/webrtc.gni +++ b/webrtc/build/webrtc.gni @@ -172,7 +172,7 @@ webrtc_root = get_path_info("../", "abspath") # It sets defines, include paths and compilation warnings accordingly, # both for WebRTC stand-alone builds and for the scenario when WebRTC # native code is built as part of Chromium. -rtc_common_config = webrtc_root + ":common_config" +rtc_common_configs = [ webrtc_root + ":common_config" ] # Global public configuration that should be applied to all WebRTC targets. You # normally shouldn't need to include this in your target as it's automatically @@ -181,9 +181,13 @@ rtc_common_config = webrtc_root + ":common_config" # depending on the target having this config. rtc_common_inherited_config = webrtc_root + ":common_inherited_config" +if (is_ios) { + rtc_common_configs += [ webrtc_root + "/build/ios:rtc_ios_common_config" ] +} + # Common configs to remove or add in all rtc targets. rtc_remove_configs = [] -rtc_add_configs = [ rtc_common_config ] +rtc_add_configs = rtc_common_configs set_defaults("rtc_test") { configs = rtc_add_configs