4 Star 5 Fork 3

Gitee 极速下载/Nanopb

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/nanopb/nanopb
克隆/下载
BUILD.bazel 3.18 KB
一键复制 编辑 原始数据 按行查看 历史
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
# Note: if you are still using WORKSPACE, you will need to patch this file to use the following instead
# load("@python_3_11//:defs.bzl", "py_binary")
load("@python_versions//3.11:defs.bzl", "py_binary")
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@rules_proto_grpc//:defs.bzl", "proto_plugin")
load("@rules_python//python:proto.bzl", "py_proto_library")
load("@rules_python//python/pip_install:requirements.bzl", "compile_pip_requirements")
load("//extra/bazel:nanopb_cc_proto_library.bzl", "cc_nanopb_proto_library")
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
exports_files(["LICENSE.txt"])
cc_library(
name = "nanopb_compilation_options_default"
)
label_flag(
name = "nanopb_compilation_options",
build_setting_default = ":nanopb_compilation_options_default"
)
cc_library(
name = "nanopb",
srcs = [
"pb_common.c",
"pb_decode.c",
"pb_encode.c",
],
hdrs = [
"pb.h",
"pb_common.h",
"pb_decode.h",
"pb_encode.h",
],
visibility = ["//visibility:public"],
deps = [":nanopb_compilation_options"],
)
copy_file(
name = "protoc-gen-nanopb.py",
src = "generator/protoc-gen-nanopb",
out = "generator/protoc-gen-nanopb.py",
allow_symlink = True,
)
py_binary(
name = "protoc-gen-nanopb",
srcs = glob([
"generator/**/*.py",
]) + [
":protoc-gen-nanopb.py",
],
data = glob([
"generator/**/*.proto",
]),
env = {
"NANOPB_PB2_NO_REBUILD": "1",
},
imports = [
"generator",
],
deps = [
":nanopb_py_proto",
],
)
proto_plugin(
name = "nanopb_plugin",
env = {
"NANOPB_PB2_NO_REBUILD": "1",
},
options = [
"--library-include-format=quote",
],
outputs = [
"{protopath}.pb.h",
"{protopath}.pb.c",
],
separate_options_flag = True,
tool = ":protoc-gen-nanopb",
use_built_in_shell_environment = False,
visibility = ["//visibility:public"],
)
proto_library(
name = "nanopb_proto",
srcs = [
"generator/proto/nanopb.proto",
],
strip_import_prefix = "generator/proto/",
deps = ["@protobuf//:descriptor_proto"],
)
py_proto_library(
name = "nanopb_py_proto",
deps = [":nanopb_proto"],
)
cc_nanopb_proto_library(
name = "test_compilation",
protos = ["@protobuf//:descriptor_proto"],
visibility = ["//visibility:private"],
)
proto_library(
name = "all_types_proto",
srcs = ["tests/alltypes/alltypes.proto"],
)
cc_nanopb_proto_library(
name = "all_types_nanopb",
nanopb_options_files = ["tests/alltypes/alltypes.options"],
protos = [":all_types_proto"],
visibility = ["//visibility:private"],
)
cc_test(
name = "bazel_options_support",
srcs = ["tests/bazel_options_support/bazel_options_support.cc"],
deps = [":all_types_nanopb"],
)
# Run `bazel run //:requirements.update` if you want to update the requirements.
compile_pip_requirements(
name = "requirements",
extra_args = ["--allow-unsafe"],
requirements_in = "extra/requirements.txt",
requirements_txt = "extra/requirements_lock.txt",
)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/nanopb.git
git@gitee.com:mirrors/nanopb.git
mirrors
nanopb
Nanopb
master

搜索帮助