OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 declare_args() { | 5 declare_args() { |
6 # SDK path to use. When empty this will use the default SDK based on the | 6 # SDK path to use. When empty this will use the default SDK based on the |
7 # value of use_ios_simulator. | 7 # value of use_ios_simulator. |
8 ios_sdk_path = "" | 8 ios_sdk_path = "" |
9 ios_sdk_name = "" | 9 ios_sdk_name = "" |
10 ios_sdk_version = "" | 10 ios_sdk_version = "" |
11 ios_sdk_platform = "" | 11 ios_sdk_platform = "" |
12 ios_sdk_platform_path = "" | 12 ios_sdk_platform_path = "" |
13 xcode_version = "" | 13 xcode_version = "" |
14 xcode_build = "" | 14 xcode_build = "" |
15 machine_os_build = "" | 15 machine_os_build = "" |
16 | 16 |
17 use_ios_simulator = current_cpu == "x86" || current_cpu == "x64" | |
18 | |
19 # Version of iOS that we're targeting. | 17 # Version of iOS that we're targeting. |
20 ios_deployment_target = "9.0" | 18 ios_deployment_target = "9.0" |
21 | 19 |
22 # The iOS Code signing identity to use | 20 # The iOS Code signing identity to use |
23 # TODO(GYP), TODO(sdfresne): Consider having a separate | 21 # TODO(GYP), TODO(sdfresne): Consider having a separate |
24 # ios_enable_code_signing_flag=<bool> flag to make the invocation clearer. | 22 # ios_enable_code_signing_flag=<bool> flag to make the invocation clearer. |
25 ios_enable_code_signing = true | 23 ios_enable_code_signing = true |
26 ios_code_signing_identity = "" | 24 ios_code_signing_identity = "" |
27 | 25 |
28 # If non-empty, this list must contain valid cpu architecture, and the final | 26 # If non-empty, this list must contain valid cpu architecture, and the final |
29 # build will be a multi-architecture build (aka fat build) supporting the | 27 # build will be a multi-architecture build (aka fat build) supporting the |
30 # main $target_cpu architecture and all of $additional_target_cpus. | 28 # main $target_cpu architecture and all of $additional_target_cpus. |
31 # | 29 # |
32 # For example to build an application that will run on both arm64 and armv7 | 30 # For example to build an application that will run on both arm64 and armv7 |
33 # devices, you would use the following in args.gn file when running "gn args": | 31 # devices, you would use the following in args.gn file when running "gn args": |
34 # | 32 # |
35 # target_os = "ios" | 33 # target_os = "ios" |
36 # target_cpu = "arm64" | 34 # target_cpu = "arm64" |
37 # additional_target_cpus = [ "arm" ] | 35 # additional_target_cpus = [ "arm" ] |
38 # | 36 # |
39 # You can also pass the value via "--args" parameter for "gn gen" command by | 37 # You can also pass the value via "--args" parameter for "gn gen" command by |
40 # using the syntax --args='additional_target_cpus=["arm"] target_cpu="arm64"'. | 38 # using the syntax --args='additional_target_cpus=["arm"] target_cpu="arm64"'. |
41 additional_target_cpus = [] | 39 additional_target_cpus = [] |
42 } | 40 } |
43 | 41 |
44 assert(custom_toolchain == "" || additional_target_cpus == [], | 42 assert(custom_toolchain == "" || additional_target_cpus == [], |
45 "cannot define both custom_toolchain and additional_target_cpus") | 43 "cannot define both custom_toolchain and additional_target_cpus") |
46 | 44 |
| 45 use_ios_simulator = current_cpu == "x86" || current_cpu == "x64" |
| 46 |
47 # Initialize additional_toolchains from additional_target_cpus. Assert here | 47 # Initialize additional_toolchains from additional_target_cpus. Assert here |
48 # that the list does not contains $target_cpu nor duplicates as this would | 48 # that the list does not contains $target_cpu nor duplicates as this would |
49 # cause weird errors during the build. | 49 # cause weird errors during the build. |
50 additional_toolchains = [] | 50 additional_toolchains = [] |
51 if (additional_target_cpus != []) { | 51 if (additional_target_cpus != []) { |
52 foreach(_additional_target_cpu, additional_target_cpus) { | 52 foreach(_additional_target_cpu, additional_target_cpus) { |
53 assert(_additional_target_cpu != target_cpu, | 53 assert(_additional_target_cpu != target_cpu, |
54 "target_cpu must not be listed in additional_target_cpus") | 54 "target_cpu must not be listed in additional_target_cpus") |
55 | 55 |
56 _toolchain = "//build/toolchain/mac:ios_clang_$_additional_target_cpu" | 56 _toolchain = "//build/toolchain/mac:ios_clang_$_additional_target_cpu" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 ios_code_signing_identity = _ios_identities[0] | 97 ios_code_signing_identity = _ios_identities[0] |
98 } | 98 } |
99 | 99 |
100 if (ios_code_signing_identity == "") { | 100 if (ios_code_signing_identity == "") { |
101 print("Tried to prepare a device build without specifying a code signing") | 101 print("Tried to prepare a device build without specifying a code signing") |
102 print("identity and could not detect one automatically either.") | 102 print("identity and could not detect one automatically either.") |
103 print("TIP: Simulator builds don't require code signing...") | 103 print("TIP: Simulator builds don't require code signing...") |
104 assert(false) | 104 assert(false) |
105 } | 105 } |
106 } | 106 } |
OLD | NEW |