diff options
Diffstat (limited to 'rules/CC/proto/RULES')
-rw-r--r-- | rules/CC/proto/RULES | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/rules/CC/proto/RULES b/rules/CC/proto/RULES index 65b8a7a..a191f16 100644 --- a/rules/CC/proto/RULES +++ b/rules/CC/proto/RULES @@ -7,7 +7,14 @@ ] , "target_fields": ["base", "toolchain", "deps"] , "string_fields": - ["PROTOC", "LDFLAGS", "ADD_LDFLAGS", "GRPC_PLUGIN", "PATH"] + [ "PROTOC" + , "PROTOCFLAGS" + , "ADD_PROTOCFLAGS" + , "LDFLAGS" + , "ADD_LDFLAGS" + , "GRPC_PLUGIN" + , "PATH" + ] , "config_vars": ["ARCH", "HOST_ARCH"] , "field_doc": { "base": @@ -41,6 +48,14 @@ , "to be the relative path to the plugin in \"toolchain\". Specifying" , "this field overwrites values from \"base\"." ] + , "PROTOCFLAGS": + [ "Protobuf compiler flags. Specifying this field overwrites values from" + , "\"base\"." + ] + , "ADD_PROTOCFLAGS": + [ "Additional protobuf compiler flags. Specifying this field extends" + , "values from \"base\"." + ] , "LDFLAGS": [ "Linker flags for linking the final CC library. Specifying this field" , "overwrites values from \"base\"." @@ -76,6 +91,7 @@ { "type": "let*" , "bindings": [ ["PROTOC", {"type": "FIELD", "name": "PROTOC"}] + , ["PROTOCFLAGS", {"type": "FIELD", "name": "PROTOCFLAGS"}] , ["LDFLAGS", {"type": "FIELD", "name": "LDFLAGS"}] , ["GRPC_PLUGIN", {"type": "FIELD", "name": "GRPC_PLUGIN"}] , ["PATH", {"type": "FIELD", "name": "PATH"}] @@ -87,6 +103,14 @@ , "else": {"type": "CALL_EXPRESSION", "name": "base-provides"} } ] + , ["provider", "PROTOCFLAGS"] + , [ "PROTOCFLAGS" + , { "type": "if" + , "cond": {"type": "var", "name": "PROTOCFLAGS"} + , "then": {"type": "var", "name": "PROTOCFLAGS"} + , "else": {"type": "CALL_EXPRESSION", "name": "base-provides-++"} + } + ] , ["provider", "LDFLAGS"] , [ "LDFLAGS" , { "type": "if" @@ -188,6 +212,14 @@ } } ] + , [ "PROTOCFLAGS" + , { "type": "++" + , "$1": + [ {"type": "var", "name": "PROTOCFLAGS"} + , {"type": "FIELD", "name": "ADD_PROTOCFLAGS"} + ] + } + ] , [ "LDFLAGS" , { "type": "++" , "$1": @@ -221,6 +253,7 @@ { "type": "env" , "vars": [ "PROTOC" + , "PROTOCFLAGS" , "LDFLAGS" , "GRPC_PLUGIN" , "PATH" |