summaryrefslogtreecommitdiff
path: root/rules/CC/proto/RULES
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2022-12-12 11:47:52 +0100
committerOliver Reiche <oliver.reiche@huawei.com>2022-12-12 11:47:52 +0100
commit6e10ee13df0b83511d7fe94bb755ac53f993c0ec (patch)
tree64615ddb751a207ae8da42a620f085795cf1c035 /rules/CC/proto/RULES
parent247e09b1ba01deb5649c6a73a7f272e1f72178fe (diff)
parentd44be66f2a916168e0f5a7055e49f12c252b2cd2 (diff)
downloadrules-cc-6e10ee13df0b83511d7fe94bb755ac53f993c0ec.tar.gz
Add 'rules/' from commit 'd44be66f2a916168e0f5a7055e49f12c252b2cd2'
git-subtree-dir: rules git-subtree-mainline: 247e09b1ba01deb5649c6a73a7f272e1f72178fe git-subtree-split: d44be66f2a916168e0f5a7055e49f12c252b2cd2
Diffstat (limited to 'rules/CC/proto/RULES')
-rw-r--r--rules/CC/proto/RULES93
1 files changed, 93 insertions, 0 deletions
diff --git a/rules/CC/proto/RULES b/rules/CC/proto/RULES
new file mode 100644
index 0000000..d1cfc4e
--- /dev/null
+++ b/rules/CC/proto/RULES
@@ -0,0 +1,93 @@
+{ "library":
+ { "doc":
+ [ "A library C++ library, generated from proto files."
+ , ""
+ , "This rule usually is used to bind anonymous targets generated from"
+ , "proto libraries."
+ ]
+ , "string_fields": ["name", "stage"]
+ , "target_fields": ["srcs", "deps"]
+ , "config_vars":
+ ["OS", "ARCH", "HOST_ARCH", "CXX", "CFLAGS", "ADD_CFLAGS", "AR", "ENV"]
+ , "implicit":
+ { "protoc": [["@", "protoc", "", "protoc"]]
+ , "defaults": [["./", "..", "defaults"]]
+ , "proto-deps": [["@", "protoc", "", "C++ runtime"]]
+ , "well_known_protos": [["@", "protoc", "", "well_known_protos"]]
+ }
+ , "imports":
+ { "protoc-compile": "protoc-compile"
+ , "host transition": ["transitions", "for host"]
+ }
+ , "config_transitions":
+ {"protoc": [{"type": "CALL_EXPRESSION", "name": "host transition"}]}
+ , "expression":
+ { "type": "let*"
+ , "bindings":
+ [ ["name", {"type": "join", "$1": {"type": "FIELD", "name": "name"}}]
+ , [ "stage"
+ , { "type": "join"
+ , "separator": "/"
+ , "$1": {"type": "FIELD", "name": "stage"}
+ }
+ ]
+ , [ "deps-transition"
+ , {"type": "CALL_EXPRESSION", "name": "host transition"}
+ ]
+ , ["public-fieldnames", ["deps", "proto-deps"]]
+ , ["private-fieldnames", ["deps", "proto-deps"]]
+ ]
+ , "body": {"type": "CALL_EXPRESSION", "name": "protoc-compile"}
+ }
+ }
+, "service library":
+ { "doc":
+ [ "A service library C++ library, generated from proto files."
+ , ""
+ , "Calls protoc with gRPC plugin to additionally generate gRPC services"
+ , "from proto libraries."
+ ]
+ , "string_fields": ["name", "stage"]
+ , "target_fields": ["srcs", "deps"]
+ , "config_vars":
+ ["OS", "ARCH", "HOST_ARCH", "CXX", "CXXFLAGS", "ADD_CXXFLAGS", "AR", "ENV"]
+ , "implicit":
+ { "protoc": [["@", "protoc", "", "protoc"]]
+ , "grpc_cpp_plugin": [["@", "grpc", "src/compiler", "grpc_cpp_plugin"]]
+ , "defaults": [["./", "..", "defaults"]]
+ , "proto-deps":
+ [ ["@", "grpc", "", "grpc++_codegen_proto"]
+ , ["@", "protoc", "", "C++ runtime"]
+ ]
+ , "well_known_protos": [["@", "protoc", "", "well_known_protos"]]
+ }
+ , "imports":
+ { "protoc-compile": "protoc-compile"
+ , "host transition": ["transitions", "for host"]
+ }
+ , "config_transitions":
+ { "protoc": [{"type": "CALL_EXPRESSION", "name": "host transition"}]
+ , "grpc_cpp_plugin":
+ [{"type": "CALL_EXPRESSION", "name": "host transition"}]
+ }
+ , "expression":
+ { "type": "let*"
+ , "bindings":
+ [ ["service support", true]
+ , ["name", {"type": "join", "$1": {"type": "FIELD", "name": "name"}}]
+ , [ "stage"
+ , { "type": "join"
+ , "separator": "/"
+ , "$1": {"type": "FIELD", "name": "stage"}
+ }
+ ]
+ , [ "deps-transition"
+ , {"type": "CALL_EXPRESSION", "name": "host transition"}
+ ]
+ , ["public-fieldnames", ["deps", "proto-deps"]]
+ , ["private-fieldnames", ["deps", "proto-deps"]]
+ ]
+ , "body": {"type": "CALL_EXPRESSION", "name": "protoc-compile"}
+ }
+ }
+}