diff --git a/BUILD.gn b/BUILD.gn index 3ff8e03ad7d..80e3bdd3757 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -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)", diff --git a/build/dart_host_sdk_toolchain.gni b/build/dart_host_sdk_toolchain.gni index 95005db5eaf..f61d287ff81 100644 --- a/build/dart_host_sdk_toolchain.gni +++ b/build/dart_host_sdk_toolchain.gni @@ -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 }