diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2022-08-26 12:05:18 +0200 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2022-09-13 10:51:13 +0200 |
commit | de4f1edc350636e4e2cde14ef1adda8716d394f6 (patch) | |
tree | 6f4f1c1b40bf3fe0dc8708ec94220475543f93c3 | |
parent | 8d810e663ff4995bbceb1f16e1fb02387d76b68f (diff) | |
download | rules-cc-de4f1edc350636e4e2cde14ef1adda8716d394f6.tar.gz |
Rules: Extend configure rule by 'compiler_family'
-rw-r--r-- | CC/EXPRESSIONS | 17 | ||||
-rw-r--r-- | CC/RULES | 7 |
2 files changed, 22 insertions, 2 deletions
diff --git a/CC/EXPRESSIONS b/CC/EXPRESSIONS index 9e83937..d04591f 100644 --- a/CC/EXPRESSIONS +++ b/CC/EXPRESSIONS @@ -49,7 +49,8 @@ } } , "configure transition": - { "expression": + { "vars": ["COMPILER_FAMILY"] + , "expression": { "type": "let*" , "bindings": [ [ "OS" @@ -75,6 +76,16 @@ , "else": {"type": "var", "name": "ARCH"} } ] + , [ "FAMILY" + , {"type": "join", "$1": {"type": "FIELD", "name": "compiler_family"}} + ] + , [ "COMPILER_FAMILY" + , { "type": "if" + , "cond": {"type": "var", "name": "FAMILY"} + , "then": {"type": "var", "name": "FAMILY"} + , "else": {"type": "var", "name": "COMPILER_FAMILY"} + } + ] ] , "body": { "type": "map_union" @@ -95,6 +106,10 @@ , "key": "TARGET_ARCH" , "value": {"type": "var", "name": "TARGET_ARCH"} } + , { "type": "singleton_map" + , "key": "COMPILER_FAMILY" + , "value": {"type": "var", "name": "COMPILER_FAMILY"} + } ] } } @@ -54,8 +54,9 @@ , "The artifacts and runfiles of the specified target will be propagated." , "The target defined by this rule does not propagate any provides data." ] - , "config_fields": ["os", "arch", "target_arch"] + , "config_fields": ["os", "arch", "target_arch", "compiler_family"] , "target_fields": ["target"] + , "config_vars": ["COMPILER_FAMILY"] , "field_doc": { "os": ["The operation system used for building."] , "arch": ["The architecture used for building."] @@ -63,6 +64,10 @@ [ "Non-mandatory target architecture to build for. If omitted, target" , "architecture is derived from \"arch\"." ] + , "compiler_family": + [ "Non-mandatory compiler family used for building. If omitted, compiler" + , "family is taken from variable \"COMPILER_FAMILY\"." + ] , "target": [ "The target to configure. Multiple targets are supported, but their" , "artifacts and runfiles should not conflict." |