blob: 509fc10d069d797e0363d2ae0ee072b31a694e5f [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.
action("go_runtime") {
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,
]
deps = [ ":go_toolchain" ]
if (host_os == "linux") {
args += [
"--bootstrap-path",
rebase_path("//buildtools/linux64/go"),
]
} else if (host_os == "mac") {
args += [
"--bootstrap-path",
rebase_path("//buildtools/mac/go"),
]
} else {
assert(false, "Go cross compiler currently only supported on Linux and Mac")
}
}
action("go_toolchain") {
outputs = [ "$root_gen_dir/goroot.done" ]
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"),
]
if (host_os == "linux") {
args += [
"--bootstrap-path",
rebase_path("//buildtools/linux64/go"),
]
} else if (host_os == "mac") {
args += [
"--bootstrap-path",
rebase_path("//buildtools/mac/go"),
]
} else {
assert(false, "Go cross compiler currently only supported on Linux and Mac")
}
}
pool("gobuild_pool") {
depth = 1
}
go_test("go_os_test") {
gopackage = "os"
}
group("go_stdlib_tests") {
testonly = true
deps = [
":go_os_test",
]
}