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/EXPRESSIONS | |
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/EXPRESSIONS')
-rw-r--r-- | CC/EXPRESSIONS | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/CC/EXPRESSIONS b/CC/EXPRESSIONS index 2a5011d..b718f76 100644 --- a/CC/EXPRESSIONS +++ b/CC/EXPRESSIONS @@ -1223,6 +1223,7 @@ , "flags": "flags" , "objects": "objects" , "default-ENV": "default-ENV" + , "default-PATH": "default-PATH" , "default-LDFLAGS": "default-LDFLAGS" , "default-TOOLCHAIN": "default-TOOLCHAIN" , "default-NON_SYSTEM_TOOLS": "default-NON_SYSTEM_TOOLS" @@ -1271,6 +1272,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"}] + } + ] + } + } + } + ] + } + ] , ["objects", {"type": "CALL_EXPRESSION", "name": "objects"}] , [ "base name" , { "type": "if" |