diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2023-07-11 14:23:22 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2023-07-12 15:25:49 +0200 |
commit | ea6dda5867d6dfb9b104196a570f95860f36c287 (patch) | |
tree | 5738c61d4c96cda697cbf91be3ebee1b95cd5e6e /rules | |
parent | 711de5ed45d06d28a67a8fecedb1985b264b1bcf (diff) | |
download | justbuild-ea6dda5867d6dfb9b104196a570f95860f36c287.tar.gz |
Add new transtion "maybe for host"
... that transitions to host, unless the ARCH_DISPATCH map indicates
that there is an execution-property transition allowing to run
actions on the TARGET_ARCH. Also make the "target properties"
available as expression as they will be needed when executing the
action on the foreign architecture.
Diffstat (limited to 'rules')
-rw-r--r-- | rules/transitions/EXPRESSIONS | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/rules/transitions/EXPRESSIONS b/rules/transitions/EXPRESSIONS index 8ea75500..4fd0d1e9 100644 --- a/rules/transitions/EXPRESSIONS +++ b/rules/transitions/EXPRESSIONS @@ -10,4 +10,48 @@ } } } +, "target properties": + { "vars": ["ARCH", "TARGET_ARCH", "ARCH_DISPATCH"] + , "expression": + { "type": "let*" + , "bindings": + [ [ "TARGET_ARCH" + , { "type": "var" + , "name": "TARGET_ARCH" + , "default": {"type": "var", "name": "ARCH"} + } + ] + ] + , "body": + { "type": "if" + , "cond": + { "type": "==" + , "$1": {"type": "var", "name": "TARGET_ARCH"} + , "$2": null + } + , "then": {"type": "empty_map"} + , "else": + { "type": "lookup" + , "map": + { "type": "var" + , "name": "ARCH_DISPATCH" + , "default": {"type": "empty_map"} + } + , "key": {"type": "var", "name": "TARGET_ARCH"} + , "default": {"type": "empty_map"} + } + } + } + } +, "maybe for host": + { "vars": ["ARCH", "HOST_ARCH", "TARGET_ARCH", "ARCH_DISPATCH"] + , "imports": + {"target properties": "target properties", "for host": "for host"} + , "expression": + { "type": "if" + , "cond": {"type": "CALL_EXPRESSION", "name": "target properties"} + , "then": {"type": "empty_map"} + , "else": {"type": "CALL_EXPRESSION", "name": "for host"} + } + } } |