diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2024-12-04 12:42:44 +0100 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2024-12-04 13:20:48 +0100 |
commit | 8c15fbdd149fd34ddc024f2ba93e650dab81098b (patch) | |
tree | 53770dda7aae7edf1fdd9fa5eda5bf7f4661ba87 | |
parent | d31fa55553a5469a7b3c530c9a4af85b23dce853 (diff) | |
download | justbuild-8c15fbdd149fd34ddc024f2ba93e650dab81098b.tar.gz |
config_file: Support PATH from defaults
-rw-r--r-- | rules/CC/auto/RULES | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/rules/CC/auto/RULES b/rules/CC/auto/RULES index 6ad967f0..34886d8e 100644 --- a/rules/CC/auto/RULES +++ b/rules/CC/auto/RULES @@ -1238,8 +1238,11 @@ , "string_fields": ["magic_string", "@only", "output"] , "target_fields": ["input"] , "config_vars": ["defines"] - , "imports": {"stage_singleton_field": ["", "stage_singleton_field"]} - , "implicit": {"runner": ["runner"]} + , "imports": + { "stage_singleton_field": ["", "stage_singleton_field"] + , "default-PATH": ["./", "..", "default-PATH"] + } + , "implicit": {"runner": ["runner"], "defaults": [["./", "..", "defaults"]]} , "expression": { "type": "let*" , "bindings": @@ -1314,6 +1317,22 @@ {"type": "CALL_EXPRESSION", "name": "stage_singleton_field"} } ] + , ["PATH", {"type": "CALL_EXPRESSION", "name": "default-PATH"}] + , [ "ENV" + , { "type": "if" + , "cond": {"type": "var", "name": "PATH"} + , "then": + { "type": "singleton_map" + , "key": "PATH" + , "value": + { "type": "join" + , "separator": ":" + , "$1": {"type": "var", "name": "PATH"} + } + } + , "else": {"type": "empty_map"} + } + ] , [ "outfile" , { "type": "ACTION" , "inputs": @@ -1331,6 +1350,7 @@ , {"type": "var", "name": "magic_string"} , {"type": "var", "name": "@only"} ] + , "env": {"type": "var", "name": "ENV"} , "outs": ["out"] } ] |