OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 # TODO(brettw) Use "gcc_toolchain.gni" like the Linux toolchains. This requires | 5 # TODO(brettw) Use "gcc_toolchain.gni" like the Linux toolchains. This requires |
6 # some enhancements since the commands on Mac are slightly different than on | 6 # some enhancements since the commands on Mac are slightly different than on |
7 # Linux. | 7 # Linux. |
8 | 8 |
9 import("../goma.gni") | 9 import("../goma.gni") |
10 import("//build/config/clang/clang.gni") | 10 import("//build/config/clang/clang.gni") |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 template("mac_toolchain") { | 66 template("mac_toolchain") { |
67 toolchain(target_name) { | 67 toolchain(target_name) { |
68 # When invoking this toolchain not as the default one, these args will be | 68 # When invoking this toolchain not as the default one, these args will be |
69 # passed to the build. They are ignored when this is the default toolchain. | 69 # passed to the build. They are ignored when this is the default toolchain. |
70 assert(defined(invoker.toolchain_args), | 70 assert(defined(invoker.toolchain_args), |
71 "Toolchains must declare toolchain_args") | 71 "Toolchains must declare toolchain_args") |
72 toolchain_args = { | 72 toolchain_args = { |
73 # Populate toolchain args from the invoker. | 73 # Populate toolchain args from the invoker. |
74 forward_variables_from(invoker.toolchain_args, "*") | 74 forward_variables_from(invoker.toolchain_args, "*") |
75 | 75 |
76 # These values need to be passed through unchanged to all secondary | 76 # The host toolchain value computed by the default toolchain's setup |
77 # toolchains. BUILDCONFIG.gn sets some defaults based on the values of | 77 # needs to be passed through unchanged to all secondary toolchains to |
78 # the operating system and compiler, and we want to force the values to | 78 # ensure that it's always the same, regardless of the values that may be |
79 # be consistent if re-running the computation in another context leads | 79 # set on those toolchains. |
80 # to different defaults. | |
81 host_toolchain = host_toolchain | 80 host_toolchain = host_toolchain |
82 target_os = target_os | |
83 target_cpu = target_cpu | |
84 } | 81 } |
85 | 82 |
86 # When the invoker has explicitly overridden use_goma or cc_wrapper in the | 83 # When the invoker has explicitly overridden use_goma or cc_wrapper in the |
87 # toolchain args, use those values, otherwise default to the global one. | 84 # toolchain args, use those values, otherwise default to the global one. |
88 # This works because the only reasonable override that toolchains might | 85 # This works because the only reasonable override that toolchains might |
89 # supply for these values are to force-disable them. | 86 # supply for these values are to force-disable them. |
90 if (defined(toolchain_args.use_goma)) { | 87 if (defined(toolchain_args.use_goma)) { |
91 toolchain_uses_goma = toolchain_args.use_goma | 88 toolchain_uses_goma = toolchain_args.use_goma |
92 } else { | 89 } else { |
93 toolchain_uses_goma = use_goma | 90 toolchain_uses_goma = use_goma |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 } | 450 } |
454 } | 451 } |
455 | 452 |
456 mac_toolchain("ios_clang_x64") { | 453 mac_toolchain("ios_clang_x64") { |
457 toolchain_args = { | 454 toolchain_args = { |
458 current_cpu = "x64" | 455 current_cpu = "x64" |
459 current_os = "ios" | 456 current_os = "ios" |
460 } | 457 } |
461 } | 458 } |
462 } | 459 } |
OLD | NEW |