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.
 
 
 
 
 
 

112 lines
2.3 KiB

# Copyright (c) 2009-2021, Google LLC
# All rights reserved.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
load(
"//upb/bazel:build_defs.bzl",
"UPB_DEFAULT_COPTS",
"UPB_DEFAULT_CPPOPTS",
)
load(
"//upb/lua:lua_proto_library.bzl",
"lua_proto_library",
)
licenses(["notice"])
cc_library(
name = "lupb",
srcs = [
"def.c",
"msg.c",
"upb.c",
],
hdrs = [
"upb.h",
],
copts = UPB_DEFAULT_COPTS,
visibility = ["//visibility:public"],
deps = [
"//upb:json",
"//upb:message",
"//upb:reflection",
"//upb:text",
"@lua//:liblua",
],
)
cc_binary(
name = "protoc-gen-lua",
srcs = ["upbc.cc"],
copts = UPB_DEFAULT_CPPOPTS,
visibility = ["//visibility:public"],
deps = [
"//src/google/protobuf/compiler:code_generator",
"@com_google_absl//absl/strings",
],
)
exports_files(["upb.lua"])
cc_test(
name = "test_lua",
srcs = ["main.c"],
args = ["$(location :test_upb.lua)"],
copts = UPB_DEFAULT_COPTS,
data = [
"test_upb.lua",
":descriptor_proto_lua",
":empty_proto_lua",
":test_messages_proto2_proto_lua",
":test_messages_proto3_proto_lua",
":test_proto_lua",
"//:descriptor_proto",
"//conformance:conformance_proto",
"//upb:third_party/lunit/console.lua",
"//upb:third_party/lunit/lunit.lua",
"//upb/lua:upb.lua",
],
linkstatic = 1,
deps = [
"//upb/lua:lupb",
"@lua//:liblua",
],
)
proto_library(
name = "test_proto",
testonly = 1,
srcs = ["test.proto"],
deps = ["//:timestamp_proto"],
)
lua_proto_library(
name = "test_proto_lua",
testonly = 1,
deps = [":test_proto"],
)
lua_proto_library(
name = "descriptor_proto_lua",
deps = ["//:descriptor_proto"],
)
lua_proto_library(
name = "empty_proto_lua",
deps = ["//:empty_proto"],
)
lua_proto_library(
name = "test_messages_proto3_proto_lua",
testonly = 1,
deps = ["//src/google/protobuf:test_messages_proto3_proto"],
)
lua_proto_library(
name = "test_messages_proto2_proto_lua",
testonly = 1,
deps = ["//src/google/protobuf:test_messages_proto2_proto"],
)