diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-06-28 09:44:15 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-06-28 09:44:15 +0200 |
commit | 3cc5e3bd441fc9d18fece3d9e99fae75c78438e7 (patch) | |
tree | a9a08c453370847e0d352d47e19fbfcb7cc757ef /build2/install/rule.cxx | |
parent | c0f72d47fc25981dcc1f55e12dfa0fdba7b70242 (diff) |
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
Diffstat (limited to 'build2/install/rule.cxx')
-rw-r--r-- | build2/install/rule.cxx | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/build2/install/rule.cxx b/build2/install/rule.cxx index 4b50a35..58182cb 100644 --- a/build2/install/rule.cxx +++ b/build2/install/rule.cxx @@ -82,6 +82,13 @@ namespace build2 { const prerequisite& p (i->prerequisite); + // Ignore excluded. + // + include_type pi (include (a, t, p)); + + if (!pi) + continue; + // Ignore unresolved targets that are imported from other projects. // We are definitely not installing those. // @@ -119,7 +126,7 @@ namespace build2 } build2::match (a, *pt); - pts.push_back (pt); + pts.push_back (prerequisite_target (pt, pi)); } return default_recipe; @@ -228,7 +235,7 @@ namespace build2 } build2::match (a, *mt); - pts.push_back (mt); + pts.push_back (mt); // Never ad hoc. } } @@ -292,6 +299,13 @@ namespace build2 { const prerequisite& p (i->prerequisite); + // Ignore excluded. + // + include_type pi (include (a, t, p)); + + if (!pi) + continue; + // Ignore unresolved targets that are imported from other projects. // We are definitely not installing those. // @@ -327,7 +341,7 @@ namespace build2 // static installable content (headers, documentation, etc). // if (!build2::match (a, *pt, unmatch::unchanged)) - pts.push_back (pt); + pts.push_back (prerequisite_target (pt, pi)); } if (a.operation () == update_id) |