3 Star 7 Fork 2

Gitee 极速下载 / protobuf_source

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/protocolbuffers/protobuf
克隆/下载
protobuf_release.bzl 1.47 KB
一键复制 编辑 原始数据 按行查看 历史
Protobuf Team Bot 提交于 2024-03-26 18:50 . Internal change
"""
Generates package naming variables for use with rules_pkg.
"""
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")
load("@rules_pkg//pkg:providers.bzl", "PackageVariablesInfo")
load(":protobuf_version.bzl", "PROTOC_VERSION")
def _package_naming_impl(ctx):
values = {}
values["version"] = PROTOC_VERSION
# infer from the current cpp toolchain.
toolchain = find_cpp_toolchain(ctx)
cpu = toolchain.cpu
system_name = toolchain.target_gnu_system_name
# rename cpus to match what we want artifacts to be
if cpu == "systemz":
cpu = "s390_64"
elif cpu == "aarch64":
cpu = "aarch_64"
elif cpu == "ppc64":
cpu = "ppcle_64"
# use the system name to determine the os and then create platform names
if "apple" in system_name:
values["platform"] = "osx-" + cpu
elif "linux" in system_name:
values["platform"] = "linux-" + cpu
elif "mingw" in system_name:
if cpu == "x86_64":
values["platform"] = "win64"
else:
values["platform"] = "win32"
else:
values["platform"] = "unknown"
return PackageVariablesInfo(values = values)
package_naming = rule(
implementation = _package_naming_impl,
attrs = {
# Necessary data dependency for find_cpp_toolchain.
"_cc_toolchain": attr.label(default = Label("@bazel_tools//tools/cpp:current_cc_toolchain")),
},
toolchains = ["@bazel_tools//tools/cpp:toolchain_type"],
)
1
https://gitee.com/mirrors/protobuf_source.git
git@gitee.com:mirrors/protobuf_source.git
mirrors
protobuf_source
protobuf_source
main

搜索帮助