-
Notifications
You must be signed in to change notification settings - Fork 0
/
go.gni
29 lines (23 loc) · 944 Bytes
/
go.gni
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
go_target_dir = "$root_build_dir/gofiles"
template("go_binary") {
action(target_name) {
forward_variables_from(invoker, ["deps"])
outputs = ["$target_out_dir/$target_name"]
depfile = "$target_out_dir/$target_name.d"
script = "//build/go.py"
args = ["--go", go_exe, "--go-cache", rebase_path("$root_build_dir/gocache"),
"--package", invoker.package,
"--gofiles-root", rebase_path(go_target_dir, root_build_dir),
"--out-bin", rebase_path(outputs[0], root_build_dir),
"--out-dep", rebase_path(depfile, root_build_dir)]
if (defined(invoker.static) && invoker.static) {
args += ["--static"]
}
if (enable_selinux) {
args += ["--selinux"]
}
}
}