• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2021 The Chromium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//build/config/ios/ios_sdk.gni")
6import("//build/toolchain/apple/toolchain.gni")
7
8# Specialisation of the apple_toolchain template to declare the toolchain
9# and its tools to build target for iOS platform.
10template("ios_toolchain") {
11  assert(defined(invoker.toolchain_args),
12         "Toolchains must declare toolchain_args")
13
14  apple_toolchain(target_name) {
15    forward_variables_from(invoker, "*", [ "toolchain_args" ])
16
17    sdk_developer_dir = ios_sdk_developer_dir
18    deployment_target = ios_deployment_target
19    target_environment = target_environment
20    bin_path = ios_bin_path
21
22    toolchain_args = {
23      forward_variables_from(invoker.toolchain_args, "*")
24      xcode_build = xcode_build
25      current_os = "ios"
26    }
27  }
28}
29
30# Specialisation of the ios_toolchain template to declare the toolchain
31# and its tools to build application extension for iOS platform.
32template("ios_app_ext_toolchain") {
33  assert(defined(invoker.toolchain_args),
34         "Toolchains must declare toolchain_args")
35
36  ios_toolchain(target_name) {
37    forward_variables_from(invoker, "*", [ "toolchain_args" ])
38
39    toolchain_args = {
40      forward_variables_from(invoker.toolchain_args, "*")
41
42      ios_is_app_extension = true
43
44      # Those variables are defined outside of //build and thus only exists
45      # when used as part of Chromium. Use build_with_chromium to check if
46      # they can be overridden safely. This prevents breaking third-party
47      # projects such as WebRTC that only uses //build but not //base.
48      if (build_with_chromium) {
49        use_partition_alloc = false
50        ios_partition_alloc_enabled = false
51      }
52    }
53  }
54}
55
56ios_toolchain("ios_clang_arm64") {
57  toolchain_args = {
58    current_cpu = "arm64"
59  }
60}
61
62ios_toolchain("ios_clang_arm") {
63  toolchain_args = {
64    current_cpu = "arm"
65  }
66}
67
68ios_toolchain("ios_clang_x64") {
69  toolchain_args = {
70    current_cpu = "x64"
71  }
72}
73
74ios_toolchain("ios_clang_x86") {
75  toolchain_args = {
76    current_cpu = "x86"
77  }
78}
79
80ios_app_ext_toolchain("ios_clang_arm64_app_ext") {
81  toolchain_args = {
82    current_cpu = "arm64"
83  }
84}
85
86ios_app_ext_toolchain("ios_clang_arm64_app_ext_13_4") {
87  toolchain_args = {
88    current_cpu = "arm64"
89    ios_deployment_target = "13.4"
90  }
91}
92
93ios_app_ext_toolchain("ios_clang_x64_app_ext") {
94  toolchain_args = {
95    current_cpu = "x64"
96  }
97}
98
99ios_app_ext_toolchain("ios_clang_x64_app_ext_13_4") {
100  toolchain_args = {
101    current_cpu = "x64"
102    ios_deployment_target = "13.4"
103  }
104}
105