aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/build/script
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-02-24 10:03:43 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-03-02 13:26:51 +0200
commit634048a861658af2bc5c37507bf96116cf1968aa (patch)
treed6122830ed2744d86e1ddb389f0e76131e54d6be /libbuild2/build/script
parentbe66fff5ff42eaab81d2a526d8b6296c28848775 (diff)
Add update operation-specific variable with unmatch|match additional values
Note that the unmatch (match but do not update) and match (update during match) values are only supported by certain rules (and potentially only for certain prerequisite types). Additionally: - All operation-specific variables are now checked for false as an override for the prerequisite-specific include value. In particular, this can now be used to disable a prerequisite for update, for example: ./: exe{test}: update = false - The cc::link_rule now supports the update=match value for headers and ad hoc prerequisites. In particular, this can be used to make sure all the library headers are updated before matching any of its (or dependent's) object files.
Diffstat (limited to 'libbuild2/build/script')
-rw-r--r--libbuild2/build/script/parser.cxx12
-rw-r--r--libbuild2/build/script/script.cxx2
2 files changed, 7 insertions, 7 deletions
diff --git a/libbuild2/build/script/parser.cxx b/libbuild2/build/script/parser.cxx
index cba4b88..e9c8d9c 100644
--- a/libbuild2/build/script/parser.cxx
+++ b/libbuild2/build/script/parser.cxx
@@ -1622,12 +1622,12 @@ namespace build2
{
if (const target* pt =
(p.target != nullptr ? p.target :
- p.adhoc ? reinterpret_cast<target*> (p.data)
+ p.adhoc () ? reinterpret_cast<target*> (p.data)
: nullptr))
{
// Apply the --update-* filter.
//
- if (!p.adhoc && !filters.empty ())
+ if (!p.adhoc () && !filters.empty ())
{
// Compute and cache "effective" name that we will be pattern-
// matching (similar code to variable_type_map::find()).
@@ -1695,7 +1695,7 @@ namespace build2
// Mark as updated (see execute_update_prerequisites() for
// details.
//
- if (!p.adhoc)
+ if (!p.adhoc ())
p.data = 1;
}
}
@@ -1923,10 +1923,10 @@ namespace build2
if (const target* pt =
(p.target != nullptr ? p.target :
- p.adhoc ? reinterpret_cast<target*> (p.data) :
+ p.adhoc () ? reinterpret_cast<target*> (p.data) :
nullptr))
{
- if (ft == pt && (p.adhoc || p.data == 1))
+ if (ft == pt && (p.adhoc () || p.data == 1))
return false;
}
}
@@ -1968,7 +1968,7 @@ namespace build2
{
prerequisite_target& pt (pts.back ());
- if (pt.adhoc)
+ if (pt.adhoc ())
{
pt.data = reinterpret_cast<uintptr_t> (pt.target);
pt.target = nullptr;
diff --git a/libbuild2/build/script/script.cxx b/libbuild2/build/script/script.cxx
index 480903e..b230ca5 100644
--- a/libbuild2/build/script/script.cxx
+++ b/libbuild2/build/script/script.cxx
@@ -78,7 +78,7 @@ namespace build2
{
// See adhoc_buildscript_rule::execute_update_prerequisites().
//
- if (pt.target != nullptr && !pt.adhoc)
+ if (pt.target != nullptr && !pt.adhoc ())
pt.target->as_name (ns);
}