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 56# Specialisation of the ios_toolchain template to declare the toolchain 57# and its tools to build application extension for iOS platform. 58template("ios_blink_app_ext_toolchain") { 59 assert(defined(invoker.toolchain_args), 60 "Toolchains must declare toolchain_args") 61 62 ios_toolchain(target_name) { 63 forward_variables_from(invoker, "*", [ "toolchain_args" ]) 64 65 toolchain_args = { 66 forward_variables_from(invoker.toolchain_args, "*") 67 68 ios_is_app_extension = true 69 } 70 } 71} 72 73ios_toolchain("ios_clang_arm64") { 74 toolchain_args = { 75 current_cpu = "arm64" 76 } 77} 78 79ios_toolchain("ios_clang_arm64_16_0") { 80 toolchain_args = { 81 current_cpu = "arm64" 82 ios_deployment_target = "16.0" 83 } 84} 85 86ios_toolchain("ios_clang_x64") { 87 toolchain_args = { 88 current_cpu = "x64" 89 } 90} 91 92ios_toolchain("ios_clang_x64_16_0") { 93 toolchain_args = { 94 current_cpu = "x64" 95 ios_deployment_target = "16.0" 96 } 97} 98 99ios_app_ext_toolchain("ios_clang_arm64_app_ext") { 100 toolchain_args = { 101 current_cpu = "arm64" 102 } 103} 104 105ios_blink_app_ext_toolchain("ios_clang_arm64_blink_app_ext") { 106 toolchain_args = { 107 current_cpu = "arm64" 108 use_blink = true 109 } 110} 111 112ios_blink_app_ext_toolchain("ios_clang_x64_blink_app_ext") { 113 toolchain_args = { 114 current_cpu = "x64" 115 use_blink = true 116 } 117} 118 119ios_app_ext_toolchain("ios_clang_arm64_app_ext_13_4") { 120 toolchain_args = { 121 current_cpu = "arm64" 122 ios_deployment_target = "13.4" 123 } 124} 125 126ios_app_ext_toolchain("ios_clang_x64_app_ext") { 127 toolchain_args = { 128 current_cpu = "x64" 129 } 130} 131 132ios_app_ext_toolchain("ios_clang_x64_app_ext_13_4") { 133 toolchain_args = { 134 current_cpu = "x64" 135 ios_deployment_target = "13.4" 136 } 137} 138 139ios_toolchain("ios_clang_arm64_blink") { 140 toolchain_args = { 141 current_cpu = "arm64" 142 use_blink = true 143 } 144} 145