Protocol Buffers - Google's data interchange format (grpc依赖)
https://developers.google.com/protocol-buffers/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.1 KiB
46 lines
1.1 KiB
load( |
|
"//bazel:build_defs.bzl", |
|
"UPB_DEFAULT_COPTS", |
|
) |
|
|
|
cc_binary( |
|
name = "message", |
|
srcs = [ |
|
"descriptor.c", |
|
"descriptor.h", |
|
"descriptor_pool.c", |
|
"descriptor_pool.h", |
|
"protobuf.c", |
|
"protobuf.h", |
|
], |
|
copts = UPB_DEFAULT_COPTS + [ |
|
# The Python API requires patterns that are ISO C incompatible, like |
|
# casts between function pointers and object pointers. |
|
"-Wno-pedantic", |
|
], |
|
linkopts = ["-Wl,--version-script,$(location :version_script.lds)"], |
|
linkshared = True, |
|
linkstatic = True, |
|
deps = [ |
|
":version_script.lds", |
|
"//:reflection", |
|
"//:upb", |
|
"@python_headers", |
|
], |
|
) |
|
|
|
# Copy the extension into the location recognized by Python. |
|
genrule( |
|
name = "message_ext", |
|
srcs = [":message"], |
|
outs = ["google/protobuf/pyext/_message.cpython-39-x86_64-linux-gnu.so"], |
|
cmd = "cp $< $@", |
|
) |
|
|
|
py_test( |
|
name = "minimal_test", |
|
srcs = ["minimal_test.py"], |
|
data = [":message_ext"], |
|
imports = ["."], |
|
legacy_create_init = False, |
|
)
|
|
|