github.com/Uhtred009/v2ray-core-1@v4.31.2+incompatible/main/targets.bzl (about)

     1  load("//infra/bazel:build.bzl", "foreign_go_binary")
     2  
     3  def gen_targets(matrix):
     4    pkg = "./main"
     5    output = "v2ray"
     6  
     7    for (os, arch, ver) in matrix:
     8  
     9      if arch in ["arm"]:
    10        bin_name = "v2ray_" + os + "_" + arch + "_" + ver
    11        foreign_go_binary(
    12          name = bin_name,
    13          pkg = pkg,
    14          output = output,
    15          os = os,
    16          arch = arch,
    17          ver = ver,
    18          arm = ver,
    19        )
    20  
    21        if os in ["windows"]:
    22          bin_name = "v2ray_" + os + "_" + arch + "_" + ver + "_nowindow"
    23          foreign_go_binary(
    24            name = bin_name,
    25            pkg = pkg,
    26            output = "w" + output,
    27            os = os,
    28            arch = arch,
    29            ver = ver,
    30            arm = ver,
    31            ld = "-H windowsgui",
    32          )
    33  
    34      else:
    35        bin_name = "v2ray_" + os + "_" + arch
    36        foreign_go_binary(
    37          name = bin_name,
    38          pkg = pkg,
    39          output = output,
    40          os = os,
    41          arch = arch,
    42          ver = ver,
    43        )
    44  
    45        if os in ["windows"]:
    46          bin_name = "v2ray_" + os + "_" + arch + "_nowindow"
    47          foreign_go_binary(
    48            name = bin_name,
    49            pkg = pkg,
    50            output = "w" + output,
    51            os = os,
    52            arch = arch,
    53            ver = ver,
    54            ld = "-H windowsgui",
    55          )
    56  
    57        if arch in ["mips", "mipsle"]:
    58          bin_name = "v2ray_" + os + "_" + arch + "_softfloat"
    59          foreign_go_binary(
    60            name = bin_name,
    61            pkg = pkg,
    62            output = output + "_softfloat",
    63            os = os,
    64            arch = arch,
    65            ver = ver,
    66            mips = "softfloat",
    67          )