Chromium Code Reviews| Index: build/config/BUILDCONFIG.gn |
| diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn |
| index 234332b8547e95b0185e9bc4bcaaf1c1bfedcf63..e3a324f56568ba91100fb3c1087be8b72273b7c4 100644 |
| --- a/build/config/BUILDCONFIG.gn |
| +++ b/build/config/BUILDCONFIG.gn |
| @@ -132,9 +132,26 @@ declare_args() { |
| cros_use_custom_toolchain = false |
| } |
| + # Allows the path to a custom target toolchain to be injected as a single |
| + # argument, and set as the default toolchain. |
| + # Note: On ChromeOS, do not set this argument. Instead, set |
| + # cros_use_custom_toolchain, and set each of the args required by |
| + # //build/toolchain/cros:target. |
| + custom_toolchain = "" |
|
brettw
2015/09/28 19:58:28
We need to keep this file cleaner than this. Pleas
slan
2015/09/28 20:50:40
There are two paths around this redundancy:
1) Al
slan
2015/09/28 21:21:42
Removed.
|
| + |
| # DON'T ADD MORE FLAGS HERE. Read the comment above. |
| } |
| +if (current_os == "chromeos") { |
| + assert( |
| + custom_toolchain == "", |
| + "|custom_toolchain| should not be set in args on ChromeOS. Set cros_use_custom_toolchain instead.") |
| + |
| + if (cros_use_custom_toolchain) { |
| + custom_toolchain = "//build/toolchain/cros:target" |
| + } |
| +} |
| + |
| # ============================================================================= |
| # OS DEFINITIONS |
| # ============================================================================= |
| @@ -530,9 +547,6 @@ if (is_win) { |
| host_toolchain = "//build/toolchain/linux:$host_cpu" |
| set_default_toolchain("//build/toolchain/linux:$current_cpu") |
| } |
| - if (is_chromeos && cros_use_custom_toolchain) { |
| - set_default_toolchain("//build/toolchain/cros:target") |
| - } |
| } else if (is_mac) { |
| host_toolchain = "//build/toolchain/mac:clang_x64" |
| set_default_toolchain(host_toolchain) |
| @@ -547,6 +561,11 @@ if (is_win) { |
| host_toolchain = "//build/toolchain/linux:clang_x64" |
| } |
| +# Set the custom default toolchain. |
| +if (custom_toolchain != "") { |
| + set_default_toolchain(custom_toolchain) |
|
brettw
2015/09/28 19:58:28
let's restructure the code above to assign to a va
slan
2015/09/28 20:50:40
Done.
|
| +} |
| + |
| # ============================================================================== |
| # COMPONENT SETUP |
| # ============================================================================== |