summaryrefslogtreecommitdiff
path: root/CC/proto
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2023-08-10 11:01:21 +0200
committerOliver Reiche <oliver.reiche@huawei.com>2023-08-16 15:30:32 +0200
commitec6dc0a5b6f5a8320f02ce926be3ba01e24a27ff (patch)
tree174e3ba3da4d9c85bc3e5a991744927ddd1bbe29 /CC/proto
parent4830f2de654d2a4d43dcca3c8ad21fecea622378 (diff)
downloadrules-cc-ec6dc0a5b6f5a8320f02ce926be3ba01e24a27ff.tar.gz
rules: Extend toolchains via defaults from base
Diffstat (limited to 'CC/proto')
-rw-r--r--CC/proto/RULES39
1 files changed, 22 insertions, 17 deletions
diff --git a/CC/proto/RULES b/CC/proto/RULES
index 6d2e725..cfc3786 100644
--- a/CC/proto/RULES
+++ b/CC/proto/RULES
@@ -19,7 +19,7 @@
[ "Optional toolchain directory. A collection of artifacts that provide"
, "the protobuf compiler and the GRPC plugin (if needed). Note that only"
, "artifacts of the specified targets are considered (no runfiles etc.)."
- , "Specifying this field overlays artifacts from \"base\"."
+ , "Specifying this field extends artifacts from \"base\"."
]
, "deps":
[ "Optional CC libraries the resulting CC proto libraries implicitly"
@@ -56,7 +56,8 @@
}
, "imports":
{ "base-provides": ["./", "..", "defaults-base-provides"]
- , "artifacts": ["", "field_artifacts"]
+ , "base-provides-list": ["./", "..", "defaults-base-provides-list"]
+ , "artifacts_list": ["", "field_artifacts_list"]
, "compile-deps": ["CC", "compile-deps"]
, "compile-args-deps": ["CC", "compile-args-deps"]
, "link-deps": ["CC", "link-deps"]
@@ -158,24 +159,28 @@
, ["provider", "TOOLCHAIN"]
, ["default", {"type": "empty_map"}]
, [ "TOOLCHAIN"
- , { "type": "map_union"
+ , { "type": "disjoint_map_union"
+ , "msg": "toolchain artifacts may not overlap"
, "$1":
- [ {"type": "CALL_EXPRESSION", "name": "base-provides"}
- , { "type": "if"
- , "cond": {"type": "FIELD", "name": "toolchain"}
- , "then":
- { "type": "let*"
- , "bindings":
- [ ["fieldname", "toolchain"]
- , [ "transition"
- , {"type": "CALL_EXPRESSION", "name": "for host"}
+ { "type": "++"
+ , "$1":
+ [ {"type": "CALL_EXPRESSION", "name": "base-provides-list"}
+ , { "type": "if"
+ , "cond": {"type": "FIELD", "name": "toolchain"}
+ , "then":
+ { "type": "let*"
+ , "bindings":
+ [ ["fieldname", "toolchain"]
+ , [ "transition"
+ , {"type": "CALL_EXPRESSION", "name": "for host"}
+ ]
]
- ]
- , "body": {"type": "CALL_EXPRESSION", "name": "artifacts"}
+ , "body":
+ {"type": "CALL_EXPRESSION", "name": "artifacts_list"}
+ }
}
- , "else": {"type": "empty_map"}
- }
- ]
+ ]
+ }
}
]
, [ "LDFLAGS"