1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-01-30 21:26:33 -05:00
v2fly/infra/control/main/targets.bzl

46 lines
1.0 KiB
Python
Raw Normal View History

2019-02-10 13:19:05 -05:00
load("//infra/bazel:build.bzl", "foreign_go_binary")
2019-02-10 13:04:11 -05:00
def gen_targets(matrix):
pkg = "v2ray.com/core/infra/control/main"
2020-07-18 22:40:33 -04:00
output = "v2ctl"
2019-02-10 13:04:11 -05:00
2020-07-18 22:40:33 -04:00
for (os, arch, ver) in matrix:
2019-02-10 13:04:11 -05:00
if arch in ["arm"]:
2020-07-18 22:40:33 -04:00
bin_name = "v2ctl_" + os + "_" + arch + "_" + ver
2019-02-10 13:04:11 -05:00
foreign_go_binary(
name = bin_name,
pkg = pkg,
2020-07-18 22:40:33 -04:00
output = output,
2020-06-28 06:11:50 -04:00
os = os,
arch = arch,
2020-07-18 22:40:33 -04:00
ver = ver,
arm = ver,
2020-06-28 06:11:50 -04:00
gotags = "confonly",
)
2020-07-18 22:40:33 -04:00
else:
bin_name = "v2ctl_" + os + "_" + arch
2020-06-28 06:11:50 -04:00
foreign_go_binary(
name = bin_name,
pkg = pkg,
output = output,
os = os,
arch = arch,
2020-07-18 22:40:33 -04:00
ver = ver,
2020-06-28 06:11:50 -04:00
gotags = "confonly",
)
2020-07-18 22:40:33 -04:00
if arch in ["mips", "mipsle"]:
bin_name = "v2ctl_" + os + "_" + arch + "_softfloat"
foreign_go_binary(
name = bin_name,
pkg = pkg,
output = output + "_softfloat",
os = os,
arch = arch,
ver = ver,
mips = "softfloat",
gotags = "confonly",
)