diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2022-12-06 16:51:56 +0100 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2022-12-09 13:13:21 +0100 |
commit | 9d5af26d047744cba54d6597ad59d23aca4e1369 (patch) | |
tree | 9c738cc9a3fdfda2ab8d43c86a016a358f8fcff9 /CC/test | |
parent | 164bc8a638e50a69466dae5f1b0e0355daa5f20c (diff) | |
download | rules-cc-9d5af26d047744cba54d6597ad59d23aca4e1369.tar.gz |
rules: Add cross-compile support for tests
Diffstat (limited to 'CC/test')
-rw-r--r-- | CC/test/RULES | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/CC/test/RULES b/CC/test/RULES index 44cf1c4..4425fd6 100644 --- a/CC/test/RULES +++ b/CC/test/RULES @@ -1,8 +1,5 @@ { "test": - { "doc": - [ "A test written in C++" - , "FIXME: the test binary and data must be built for host" - ] + { "doc": ["A test written in C++"] , "tainted": ["test"] , "target_fields": ["srcs", "private-hdrs", "private-deps", "data"] , "string_fields": @@ -15,7 +12,9 @@ , "private-ldflags" ] , "config_vars": - [ "CC" + [ "ARCH" + , "HOST_ARCH" + , "CC" , "CXX" , "CFLAGS" , "CXXFLAGS" @@ -103,6 +102,12 @@ , "link-deps": ["./", "..", "link-deps"] , "link-args-deps": ["./", "..", "link-args-deps"] , "binary": ["./", "..", "bin artifact"] + , "host transition": ["transitions", "for host"] + } + , "config_transitions": + { "defaults": [{"type": "CALL_EXPRESSION", "name": "host transition"}] + , "private-deps": [{"type": "CALL_EXPRESSION", "name": "host transition"}] + , "data": [{"type": "CALL_EXPRESSION", "name": "host transition"}] } , "expression": { "type": "let*" @@ -140,6 +145,9 @@ } } ] + , ["host-trans", {"type": "CALL_EXPRESSION", "name": "host transition"}] + , ["defaults-transition", {"type": "var", "name": "host-trans"}] + , ["deps-transition", {"type": "var", "name": "host-trans"}] , ["deps-fieldnames", ["private-deps"]] , ["compile-deps", {"type": "CALL_EXPRESSION", "name": "compile-deps"}] , [ "compile-args" @@ -238,7 +246,10 @@ , "msg": "Data runfiles may not conflict" , "$1": { "type": "let*" - , "bindings": [["fieldname", "data"]] + , "bindings": + [ ["fieldname", "data"] + , ["transition", {"type": "var", "name": "deps-transition"}] + ] , "body": {"type": "CALL_EXPRESSION", "name": "runfiles_list"} } } |