From 0d35d779351a30d8b2bb6c27bca94acf56d6143d Mon Sep 17 00:00:00 2001 From: Oliver Reiche Date: Tue, 25 Apr 2023 17:35:35 +0200 Subject: rules: Support mixing system/toolchain for protoc/grpc --- CC/proto/RULES | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'CC/proto/RULES') diff --git a/CC/proto/RULES b/CC/proto/RULES index c6568cd..6d2e725 100644 --- a/CC/proto/RULES +++ b/CC/proto/RULES @@ -115,6 +115,46 @@ , "else": {"type": "CALL_EXPRESSION", "name": "base-provides"} } ] + , ["provider", "NON_SYSTEM_TOOLS"] + , ["default", {"type": "empty_map"}] + , [ "NON_SYSTEM_TOOLS" + , { "type": "map_union" + , "$1": + { "type": "++" + , "$1": + [ [{"type": "CALL_EXPRESSION", "name": "base-provides"}] + , { "type": "if" + , "cond": {"type": "FIELD", "name": "PROTOC"} + , "then": + [ { "type": "singleton_map" + , "key": "PROTOC" + , "value": + { "type": "if" + , "cond": {"type": "FIELD", "name": "toolchain"} + , "then": true + , "else": false + } + } + ] + } + , { "type": "if" + , "cond": {"type": "FIELD", "name": "GRPC_PLUGIN"} + , "then": + [ { "type": "singleton_map" + , "key": "GRPC_PLUGIN" + , "value": + { "type": "if" + , "cond": {"type": "FIELD", "name": "toolchain"} + , "then": true + , "else": false + } + } + ] + } + ] + } + } + ] , ["provider", "TOOLCHAIN"] , ["default", {"type": "empty_map"}] , [ "TOOLCHAIN" @@ -171,6 +211,7 @@ , "GRPC_PLUGIN" , "ENV" , "TOOLCHAIN" + , "NON_SYSTEM_TOOLS" , "compile-deps" , "compile-args" , "link-deps" -- cgit v1.2.3