1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-18 02:16:10 -05:00
v2fly/main/targets.bzl

68 lines
1.5 KiB
Python
Raw Normal View History

2019-02-10 13:19:05 -05:00
load("//infra/bazel:build.bzl", "foreign_go_binary")
2018-10-03 17:27:42 -04:00
def gen_targets(matrix):
2020-10-07 06:35:21 -04:00
pkg = "./main"
2018-10-03 17:27:42 -04:00
output = "v2ray"
2020-07-18 22:40:33 -04:00
for (os, arch, ver) in matrix:
2018-10-03 17:27:42 -04:00
if arch in ["arm"]:
2020-07-18 22:40:33 -04:00
bin_name = "v2ray_" + os + "_" + arch + "_" + ver
2019-10-31 07:24:37 -04:00
foreign_go_binary(
name = bin_name,
pkg = pkg,
2020-07-18 22:40:33 -04:00
output = output,
2019-10-31 07:24:37 -04:00
os = os,
arch = arch,
2020-07-18 22:40:33 -04:00
ver = ver,
arm = ver,
2019-10-31 07:24:37 -04:00
)
2020-07-18 22:40:33 -04:00
if os in ["windows"]:
bin_name = "v2ray_" + os + "_" + arch + "_" + ver + "_nowindow"
foreign_go_binary(
name = bin_name,
pkg = pkg,
output = "w" + output,
os = os,
arch = arch,
ver = ver,
arm = ver,
ld = "-H windowsgui",
)
else:
bin_name = "v2ray_" + os + "_" + arch
2020-06-19 08:20:14 -04:00
foreign_go_binary(
name = bin_name,
pkg = pkg,
2020-06-28 04:56:55 -04:00
output = output,
2020-06-19 08:20:14 -04:00
os = os,
arch = arch,
2020-07-18 22:40:33 -04:00
ver = ver,
2020-06-19 08:20:14 -04:00
)
2020-07-18 22:40:33 -04:00
if os in ["windows"]:
bin_name = "v2ray_" + os + "_" + arch + "_nowindow"
foreign_go_binary(
name = bin_name,
pkg = pkg,
output = "w" + output,
os = os,
arch = arch,
ver = ver,
ld = "-H windowsgui",
)
if arch in ["mips", "mipsle"]:
bin_name = "v2ray_" + os + "_" + arch + "_softfloat"
foreign_go_binary(
name = bin_name,
pkg = pkg,
output = output + "_softfloat",
os = os,
arch = arch,
ver = ver,
mips = "softfloat",
)