dart-sdk/utils/compile_platform.gni
Zachary Anderson a99cdabd00 Reland: [GN] Adds dart_host_sdk_toolchain argument
Setting this build argument to something other than host_toolchain will
cause the build target create_host_sdk to be exposed. That target will
build the Dart SDK with the toolchain specified by
dart_host_sdk_toolchain.

Relanding to fix bad toolchain conditions in dart_os_config and
dart_arch_config.

TO-549

Change-Id: I276f47d9071233acb98f6029a4666da0cee33d7d
Reviewed-on: https://dart-review.googlesource.com/18361
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2017-11-02 19:02:18 +00:00

54 lines
1.6 KiB
Plaintext

# Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
# 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.
import("../build/dart_host_sdk_toolchain.gni")
import("../build/prebuilt_dart_sdk.gni")
_dart_root = get_path_info("..", "abspath")
template("compile_platform") {
assert(defined(invoker.sources), "Need 'sources' in $target_name")
assert(defined(invoker.outputs), "Need 'outputs' in $target_name")
assert(defined(invoker.args), "Need 'args' in $target_name")
assert(!defined(invoker.script), "Remove 'script' from $target_name")
assert(!defined(invoker.depfile), "Remove 'depfile' from $target_name")
action(target_name) {
script = "$_dart_root/tools/compile_platform.py"
sources = invoker.sources
outputs = invoker.outputs
inputs = []
deps = []
args = []
if (defined(invoker.deps)) {
deps += invoker.deps
}
if (defined(invoker.inputs)) {
inputs += invoker.inputs
}
depfile = outputs[0] + ".d"
if (!prebuilt_dart_exe_works) {
deps += [ "$_dart_root/runtime/bin:dart_bootstrap($dart_host_toolchain)" ]
dart_out_dir = get_label_info(
"$_dart_root/runtime/bin:dart_bootstrap($dart_host_toolchain)",
"root_out_dir")
args += [
"--dart-executable",
rebase_path("$dart_out_dir/dart_bootstrap$executable_suffix"),
]
}
args += invoker.args
args += rebase_path(sources, root_build_dir)
args += rebase_path(outputs, root_build_dir)
}
}