OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build/config/ios/ios_sdk.gni") | 5 import("//build/config/ios/ios_sdk.gni") |
6 import("//build/config/sysroot.gni") | 6 import("//build/config/sysroot.gni") |
7 import("//build/toolchain/toolchain.gni") | 7 import("//build/toolchain/toolchain.gni") |
8 | 8 |
| 9 declare_args() { |
| 10 # Enabling this option makes clang compile to an intermediate |
| 11 # representation ("bitcode"), and not to native code. This is preferred |
| 12 # when including WebRTC in the apps that will be sent to Apple's App Store |
| 13 # and mandatory for the apps that run on watchOS or tvOS. |
| 14 # The option only works when building with Xcode (use_xcode_clang = true). |
| 15 # Mimicking how Xcode handles it, the production builds (is_debug = false) |
| 16 # get real bitcode sections added, while the debug builds (is_debug = true) |
| 17 # only get bitcode-section "markers" added in them. |
| 18 # NOTE: This option is ignored when building versions for the iOS simulator, |
| 19 # where a part of libvpx is compiled from the assembly code written using |
| 20 # Intel assembly syntax; Yasm / Nasm do not support emitting bitcode parts. |
| 21 # That is not a limitation for now as Xcode mandates the presence of bitcode |
| 22 # only when building bitcode-enabled projects for real devices (ARM CPUs). |
| 23 enable_ios_bitcode = false |
| 24 } |
| 25 |
9 # This is included by reference in the //build/config/compiler:runtime_library | 26 # This is included by reference in the //build/config/compiler:runtime_library |
10 # config that is applied to all targets. It is here to separate out the logic | 27 # config that is applied to all targets. It is here to separate out the logic |
11 # that is iOS-only. Please see that target for advice on what should go in | 28 # that is iOS-only. Please see that target for advice on what should go in |
12 # :runtime_library vs. :compiler. | 29 # :runtime_library vs. :compiler. |
13 config("runtime_library") { | 30 config("runtime_library") { |
14 common_flags = [ | 31 common_flags = [ |
15 "-isysroot", | 32 "-isysroot", |
16 sysroot, | 33 sysroot, |
17 | 34 |
18 "-stdlib=libc++", | 35 "-stdlib=libc++", |
19 ] | 36 ] |
20 | 37 |
21 if (use_ios_simulator) { | 38 if (use_ios_simulator) { |
22 common_flags += [ "-mios-simulator-version-min=$ios_deployment_target" ] | 39 common_flags += [ "-mios-simulator-version-min=$ios_deployment_target" ] |
23 } else { | 40 } else { |
24 common_flags += [ "-miphoneos-version-min=$ios_deployment_target" ] | 41 common_flags += [ "-miphoneos-version-min=$ios_deployment_target" ] |
25 } | 42 } |
26 | 43 |
| 44 if (use_xcode_clang && enable_ios_bitcode && !use_ios_simulator) { |
| 45 if (is_debug) { |
| 46 common_flags += [ "-fembed-bitcode-marker" ] |
| 47 } else { |
| 48 common_flags += [ "-fembed-bitcode" ] |
| 49 } |
| 50 } |
| 51 |
27 asmflags = common_flags | 52 asmflags = common_flags |
28 cflags = common_flags | 53 cflags = common_flags |
29 ldflags = common_flags | 54 ldflags = common_flags |
30 | 55 |
31 # TODO(crbug.com/634373): Remove once Xcode's libc++ has LLVM r256325. Most | 56 # TODO(crbug.com/634373): Remove once Xcode's libc++ has LLVM r256325. Most |
32 # likely this means one Xcode 8 is released and required. | 57 # likely this means one Xcode 8 is released and required. |
33 if (use_xcode_clang && get_path_info(ios_sdk_version, "name") != "10") { | 58 if (use_xcode_clang && get_path_info(ios_sdk_version, "name") != "10") { |
34 common_cc_flags = [ | 59 common_cc_flags = [ |
35 "-isystem", | 60 "-isystem", |
36 rebase_path("//third_party/llvm-build/Release+Asserts/include/c++/v1", | 61 rebase_path("//third_party/llvm-build/Release+Asserts/include/c++/v1", |
(...skipping 20 matching lines...) Expand all Loading... |
57 | 82 |
58 libs = [ | 83 libs = [ |
59 "Foundation.framework", | 84 "Foundation.framework", |
60 "XCTest.framework", | 85 "XCTest.framework", |
61 ] | 86 ] |
62 } | 87 } |
63 | 88 |
64 group("xctest") { | 89 group("xctest") { |
65 public_configs = [ ":xctest_config" ] | 90 public_configs = [ ":xctest_config" ] |
66 } | 91 } |
OLD | NEW |