Allow the host toolchain to be set via a simple variable.

It can now be defined in a config file rather than requiring a gen argument.

Change-Id: I8f11394ee0387683c9ce48764a04b4bdf54fed9b
Bug:
Reviewed-on: https://dart-review.googlesource.com/18687
Reviewed-by: Zach Anderson <zra@google.com>
This commit is contained in:
P.Y. Laligand 2017-11-06 19:06:18 +00:00 committed by Zach Anderson
parent 00d9c180c3
commit ab25f54bf5
2 changed files with 9 additions and 10 deletions

View file

@ -74,7 +74,8 @@ group("create_sdk") {
]
}
if (dart_host_sdk_toolchain != host_toolchain) {
if (defined(dart_host_sdk_toolchain) &&
dart_host_sdk_toolchain != host_toolchain) {
group("create_host_sdk") {
deps = [
"sdk:create_sdk($dart_host_sdk_toolchain)",

View file

@ -2,17 +2,15 @@
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
declare_args() {
# In a cross-build, this should be set to the toolchain to use to build a Dart
# SDK to run on the host that targets the host. This is distinct from
# 'host_toolchain', which in a cross-build builds artifacts to run on the host
# that target the target architecture.
dart_host_sdk_toolchain = host_toolchain
}
# dart_host_toolchain should be used in the Dart tree instead of host_toolchain.
# It will ensure that we are selecting the correct host toolchain.
dart_host_toolchain = host_toolchain
if (current_toolchain == dart_host_sdk_toolchain) {
# Config variable: dart_host_sdk_toolchain
# In a cross-build, this should be set to the toolchain to use to build a Dart
# SDK to run on the host that targets the host. This is distinct from
# 'host_toolchain', which in a cross-build builds artifacts to run on the host
# that target the target architecture.
if (defined(dart_host_sdk_toolchain) && current_toolchain == dart_host_sdk_toolchain) {
dart_host_toolchain = dart_host_sdk_toolchain
}