blob: 971f860b3e6481cb7f49b55fe27c8dc089b29592 [file] [log] [blame]
# Copyright 2016 The Fuchsia Authors. 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/go/go_test.gni")
# The go_runtime action wraps go_toolchain, rebuilding just the standard
# if it has changed.
if (current_toolchain == target_toolchain) {
action("go_runtime_internal") {
visibility = [":*"]
outputs = [ "$root_gen_dir/gostdlib.done" ]
depfile = "$root_gen_dir/gostdlib.d"
script = rebase_path("//buildtools/go")
args = [
"run",
rebase_path("makestdlib.go", root_build_dir),
"-fuchsia-root",
rebase_path("//."),
"-depfile",
rebase_path(depfile),
"-root-out-dir",
rebase_path("$root_out_dir"),
"-root-gen-dir",
rebase_path("$root_gen_dir"),
"-target-cpu",
target_cpu,
"--bootstrap-path",
rebase_path("//buildtools/${host_os}-${host_cpu}/go"),
]
deps = [ ":go_toolchain" ]
}
action("go_toolchain") {
outputs = [ "$root_gen_dir/goroot.done" ]
visibility = [ ":*" ]
script = rebase_path("//buildtools/go")
args = [
"run",
rebase_path("makefuchsia.go", root_build_dir),
"-fuchsia-root",
rebase_path("//."),
"-root-gen-dir",
rebase_path("$root_gen_dir"),
"--bootstrap-path",
rebase_path("//buildtools/${host_os}-${host_cpu}/go"),
]
}
}
group("go_runtime") {
public_deps = [ ":go_runtime_internal(${target_toolchain})" ]
}
go_test("go_os_test") {
gopackage = "os"
}
group("go_stdlib_tests") {
testonly = true
deps = [
":go_os_test",
]
}