summaryrefslogtreecommitdiff
path: root/CC/auto
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2023-07-21 15:20:51 +0200
committerOliver Reiche <oliver.reiche@huawei.com>2023-08-16 15:30:32 +0200
commit161772df4241adefd2ff3440f00ee72d13987bf8 (patch)
tree2221d244c567708879c6905af1c410eb14399971 /CC/auto
parentf61161f05e88b42e9ee141a8fd4809f0e4f4e0c6 (diff)
downloadrules-cc-161772df4241adefd2ff3440f00ee72d13987bf8.tar.gz
rules: Propagate PATH list from defaults
... instead of creating an ENV from it and propagating this. The idea is to keep PATH entries separate and only join them with ":" when we need it. In this way, we can accumulate PATHs from multiple defaults later, and perform a deduplication ("nub_left") to shorten the final string length.
Diffstat (limited to 'CC/auto')
-rw-r--r--CC/auto/RULES31
1 files changed, 31 insertions, 0 deletions
diff --git a/CC/auto/RULES b/CC/auto/RULES
index 247ee01..0e156c9 100644
--- a/CC/auto/RULES
+++ b/CC/auto/RULES
@@ -156,6 +156,7 @@
, "flags-cc": ["./", "..", "flags-cc"]
, "flags-cxx": ["./", "..", "flags-cxx"]
, "default-ENV": ["./", "..", "default-ENV"]
+ , "default-PATH": ["./", "..", "default-PATH"]
, "default-TOOLCHAIN": ["./", "..", "default-TOOLCHAIN"]
, "default-NON_SYSTEM_TOOLS": ["./", "..", "default-NON_SYSTEM_TOOLS"]
}
@@ -222,6 +223,36 @@
]
}
]
+ , [ "ENV_PATH"
+ , { "type": "lookup"
+ , "map": {"type": "var", "name": "ENV"}
+ , "key": "PATH"
+ }
+ ]
+ , [ "ENV"
+ , { "type": "map_union"
+ , "$1":
+ [ {"type": "var", "name": "ENV"}
+ , { "type": "singleton_map"
+ , "key": "PATH"
+ , "value":
+ { "type": "join"
+ , "separator": ":"
+ , "$1":
+ { "type": "++"
+ , "$1":
+ [ {"type": "CALL_EXPRESSION", "name": "default-PATH"}
+ , { "type": "if"
+ , "cond": {"type": "var", "name": "ENV_PATH"}
+ , "then": [{"type": "var", "name": "ENV_PATH"}]
+ }
+ ]
+ }
+ }
+ }
+ ]
+ }
+ ]
, [ "c.flags"
, { "type": "BLOB"
, "data":