From 3cc5e3bd441fc9d18fece3d9e99fae75c78438e7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 28 Jun 2018 09:44:15 +0200 Subject: Implement support for excluded and ad hoc prerequisites The inclusion/exclusion is controlled via the 'include' prerequisite-specific variable. Valid values are: false - exclude true - include adhoc - include but treat as an ad hoc input For example: lib{foo}: cxx{win32-utility}: include = ($cxx.targe.class == 'windows') exe{bar}: libs{plugin}: include = adhoc --- build2/test/rule.cxx | 6 ++++++ build2/test/rule.hxx | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'build2/test') diff --git a/build2/test/rule.cxx b/build2/test/rule.cxx index f877a4d..282540c 100644 --- a/build2/test/rule.cxx +++ b/build2/test/rule.cxx @@ -126,6 +126,9 @@ namespace build2 for (prerequisite_member p: group_prerequisite_members (a, t, members_mode::maybe)) { + if (include (a, t, p) != include_type::normal) // Excluded/ad hoc. + continue; + if (p.is_a ()) { if (!script) @@ -205,6 +208,9 @@ namespace build2 if (vars.empty ()) // Common case. continue; + if (include (a, t, p) != include_type::normal) // Excluded/ad hoc. + continue; + bool rt ( cast_false (vars[test_roundtrip])); bool si (rt || cast_false (vars[test_stdin])); bool so (rt || cast_false (vars[test_stdout])); diff --git a/build2/test/rule.hxx b/build2/test/rule.hxx index e4fd28d..af42d89 100644 --- a/build2/test/rule.hxx +++ b/build2/test/rule.hxx @@ -9,7 +9,7 @@ #include #include -#include +#include #include -- cgit v1.1