diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2023-07-21 15:20:51 +0200 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2023-08-16 15:30:32 +0200 |
commit | 161772df4241adefd2ff3440f00ee72d13987bf8 (patch) | |
tree | 2221d244c567708879c6905af1c410eb14399971 /CC/pkgconfig/EXPRESSIONS | |
parent | f61161f05e88b42e9ee141a8fd4809f0e4f4e0c6 (diff) | |
download | rules-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/pkgconfig/EXPRESSIONS')
-rw-r--r-- | CC/pkgconfig/EXPRESSIONS | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/CC/pkgconfig/EXPRESSIONS b/CC/pkgconfig/EXPRESSIONS index 4c174c4..535faf6 100644 --- a/CC/pkgconfig/EXPRESSIONS +++ b/CC/pkgconfig/EXPRESSIONS @@ -1,6 +1,9 @@ { "pkgconfig result": { "vars": ["ENV", "name", "args", "stage"] - , "imports": {"default-ENV": ["./", "..", "default-ENV"]} + , "imports": + { "default-ENV": ["./", "..", "default-ENV"] + , "default-PATH": ["./", "..", "default-PATH"] + } , "expression": { "type": "let*" , "bindings": @@ -12,6 +15,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"}] + } + ] + } + } + } + ] + } + ] , [ "cflags-filename" , {"type": "join", "$1": [{"type": "var", "name": "name"}, ".cflags"]} ] |