diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2023-08-16 15:10:31 +0200 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2023-08-16 15:37:37 +0200 |
commit | 54bb2a33b3e36123f8f411f77ec8e76f5b021e3d (patch) | |
tree | f1ccc4416475df33a9e494cf8e27d5843bbc6a3f /CC/prebuilt | |
parent | ebf3cf04bc80ae7bf083220e63e739bf32151c95 (diff) | |
download | rules-cc-54bb2a33b3e36123f8f411f77ec8e76f5b021e3d.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/prebuilt')
-rw-r--r-- | CC/prebuilt/EXPRESSIONS | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/CC/prebuilt/EXPRESSIONS b/CC/prebuilt/EXPRESSIONS index c404bec..7b35c21 100644 --- a/CC/prebuilt/EXPRESSIONS +++ b/CC/prebuilt/EXPRESSIONS @@ -111,6 +111,7 @@ , "cflags-files-deps": ["./", "..", "cflags-files-deps"] , "ldflags-files-deps": ["./", "..", "ldflags-files-deps"] , "default-ENV": ["./", "..", "default-ENV"] + , "default-PATH": ["./", "..", "default-PATH"] } , "expression": { "type": "let*" @@ -239,6 +240,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"}] + } + ] + } + } + } + ] + } + ] , [ "main-pkg-config" , { "type": "foldl" , "range": |