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 | ee852191cec36b9a1aabe9c8fc741beb7193d0e4 (patch) | |
tree | d114e0d8ecc46a5cac75017d6d598b013ec88ff7 /rules | |
parent | 0248ad3ad5ccd0f91febff304474bd4c42fcd247 (diff) | |
download | justbuild-ee852191cec36b9a1aabe9c8fc741beb7193d0e4.tar.gz |
Rules: Extend configure rule by 'compiler_family'
Diffstat (limited to 'rules')
-rw-r--r-- | rules/CC/EXPRESSIONS | 17 | ||||
-rw-r--r-- | rules/CC/RULES | 7 |
2 files changed, 22 insertions, 2 deletions
diff --git a/rules/CC/EXPRESSIONS b/rules/CC/EXPRESSIONS index 9e839370..d04591f2 100644 --- a/rules/CC/EXPRESSIONS +++ b/rules/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"} + } ] } } diff --git a/rules/CC/RULES b/rules/CC/RULES index c2c72020..099a629b 100644 --- a/rules/CC/RULES +++ b/rules/CC/RULES @@ -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." |