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 import("//build/config/clang/clang.gni") | 5 import("//build/config/clang/clang.gni") |
6 import("//build/config/nacl/config.gni") | 6 import("//build/config/nacl/config.gni") |
7 import("//build/config/sanitizers/sanitizers.gni") | 7 import("//build/config/sanitizers/sanitizers.gni") |
8 import("//build/config/v8_target_cpu.gni") | 8 import("//build/config/v8_target_cpu.gni") |
9 import("//build/toolchain/cc_wrapper.gni") | 9 import("//build/toolchain/cc_wrapper.gni") |
10 import("//build/toolchain/goma.gni") | 10 import("//build/toolchain/goma.gni") |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 "toolchain_args must specify a current_cpu") | 92 "toolchain_args must specify a current_cpu") |
93 assert(defined(invoker_toolchain_args.current_os), | 93 assert(defined(invoker_toolchain_args.current_os), |
94 "toolchain_args must specify a current_os") | 94 "toolchain_args must specify a current_os") |
95 | 95 |
96 # When invoking this toolchain not as the default one, these args will be | 96 # When invoking this toolchain not as the default one, these args will be |
97 # passed to the build. They are ignored when this is the default toolchain. | 97 # passed to the build. They are ignored when this is the default toolchain. |
98 toolchain_args = { | 98 toolchain_args = { |
99 # Populate toolchain args from the invoker. | 99 # Populate toolchain args from the invoker. |
100 forward_variables_from(invoker_toolchain_args, "*") | 100 forward_variables_from(invoker_toolchain_args, "*") |
101 | 101 |
102 # These values need to be passed through unchanged to all secondary | 102 # The host toolchain value computed by the default toolchain's setup |
103 # toolchains. BUILDCONFIG.gn sets some defaults based on the values of | 103 # needs to be passed through unchanged to all secondary toolchains to |
104 # the operating system and compiler, and we want to force the values to | 104 # ensure that it's always the same, regardless of the values that may be |
105 # be consistent if re-running the computation in another context leads | 105 # set on those toolchains. |
106 # to different defaults. | |
107 host_toolchain = host_toolchain | 106 host_toolchain = host_toolchain |
108 target_os = target_os | |
109 target_cpu = target_cpu | |
110 | 107 |
111 if (!defined(invoker_toolchain_args.v8_current_cpu)) { | 108 if (!defined(invoker_toolchain_args.v8_current_cpu)) { |
112 v8_current_cpu = invoker_toolchain_args.current_cpu | 109 v8_current_cpu = invoker_toolchain_args.current_cpu |
113 } | 110 } |
114 } | 111 } |
115 | 112 |
116 # When the invoker has explicitly overridden use_goma or cc_wrapper in the | 113 # When the invoker has explicitly overridden use_goma or cc_wrapper in the |
117 # toolchain args, use those values, otherwise default to the global one. | 114 # toolchain args, use those values, otherwise default to the global one. |
118 # This works because the only reasonable override that toolchains might | 115 # This works because the only reasonable override that toolchains might |
119 # supply for these values are to force-disable them. | 116 # supply for these values are to force-disable them. |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 if (defined(invoker.use_debug_fission)) { | 488 if (defined(invoker.use_debug_fission)) { |
492 assert(!defined(toolchain_args.use_debug_fission)) | 489 assert(!defined(toolchain_args.use_debug_fission)) |
493 toolchain_args.use_debug_fission = invoker.use_debug_fission | 490 toolchain_args.use_debug_fission = invoker.use_debug_fission |
494 } | 491 } |
495 if (defined(invoker.use_gold)) { | 492 if (defined(invoker.use_gold)) { |
496 assert(!defined(toolchain_args.use_gold)) | 493 assert(!defined(toolchain_args.use_gold)) |
497 toolchain_args.use_gold = invoker.use_gold | 494 toolchain_args.use_gold = invoker.use_gold |
498 } | 495 } |
499 } | 496 } |
500 } | 497 } |
OLD | NEW |