From 413c9c14da147921611a16d568b29751152ed81b Mon Sep 17 00:00:00 2001 From: Oliver Reiche Date: Tue, 22 Mar 2022 12:38:08 +0100 Subject: Create IDE rule for CC targets --- CC/IDE/RULES | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 CC/IDE/RULES (limited to 'CC/IDE') diff --git a/CC/IDE/RULES b/CC/IDE/RULES new file mode 100644 index 0000000..31da688 --- /dev/null +++ b/CC/IDE/RULES @@ -0,0 +1,97 @@ +{ "headers": + { "doc": ["Transitive public headers of C++ target"] + , "target_fields": ["proto", "deps"] + , "string_fields": ["stage"] + , "field_doc": + { "proto": ["The proto source files for creating cc bindings."] + , "deps": ["The targets to obtain the headers from."] + , "stage": + [ "The logical location of the header files. Individual directory" + , "components are joined with \"/\"." + ] + } + , "anonymous": + { "proto-deps": + { "target": "proto" + , "provider": "proto" + , "rule_map": + { "library": ["./", "../proto", "library"] + , "service library": ["./", "../proto", "service library"] + } + } + } + , "imports": {"runfiles": ["./", "../..", "field_runfiles"]} + , "expression": + { "type": "let*" + , "bindings": + [ [ "stage" + , { "type": "join" + , "separator": "/" + , "$1": {"type": "FIELD", "name": "stage"} + } + ] + , [ "artifacts" + , { "type": "to_subdir" + , "subdir": {"type": "var", "name": "stage"} + , "$1": + { "type": "map_union" + , "$1": + [ { "type": "let*" + , "bindings": [["fieldname", "proto-deps"]] + , "body": {"type": "CALL_EXPRESSION", "name": "runfiles"} + } + , { "type": "map_union" + , "$1": + { "type": "foreach" + , "var": "x" + , "range": {"type": "FIELD", "name": "proto-deps"} + , "body": + { "type": "DEP_PROVIDES" + , "provider": "compile-deps" + , "dep": {"type": "var", "name": "x"} + , "default": + { "type": "fail" + , "msg": + [ "Expected a library target, but got:" + , {"type": "var", "name": "x"} + ] + } + } + } + } + , { "type": "let*" + , "bindings": [["fieldname", "deps"]] + , "body": {"type": "CALL_EXPRESSION", "name": "runfiles"} + } + , { "type": "map_union" + , "$1": + { "type": "foreach" + , "var": "x" + , "range": {"type": "FIELD", "name": "deps"} + , "body": + { "type": "DEP_PROVIDES" + , "provider": "compile-deps" + , "dep": {"type": "var", "name": "x"} + , "default": + { "type": "fail" + , "msg": + [ "Expected a library target, but got:" + , {"type": "var", "name": "x"} + ] + } + } + } + } + ] + } + } + ] + ] + , "body": + { "type": "RESULT" + , "artifacts": {"type": "var", "name": "artifacts"} + , "runfiles": {"type": "var", "name": "artifacts"} + } + } + } +} -- cgit v1.2.3