diff options
Diffstat (limited to 'libbuild2/in/rule.hxx')
-rw-r--r-- | libbuild2/in/rule.hxx | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/libbuild2/in/rule.hxx b/libbuild2/in/rule.hxx index 33caea4..67c2509 100644 --- a/libbuild2/in/rule.hxx +++ b/libbuild2/in/rule.hxx @@ -18,8 +18,14 @@ namespace build2 { // Preprocess an .in file. // - // Note that a derived rule can use the target data pad to cache data - // (e.g., in match() or apply()) to be used in substitute/lookup() calls. + // Note that a derived rule can use the target auxiliary data storage to + // cache data (e.g., in match() or apply()) to be used in substitute() and + // lookup() calls. + // + // A derived rule is also required to derive the target file name in + // match() instead of apply() to make it available early for the in{} + // prerequisite search (see install::file_rule::apply_impl() for + // background). // // Note also that currently this rule ignores the dry-run mode (see // perform_update() for the rationale). @@ -43,7 +49,7 @@ namespace build2 null_ (move (null)) {} virtual bool - match (action, target&, const string&) const override; + match (action, target&) const override; virtual recipe apply (action, target&) const override; @@ -53,6 +59,7 @@ namespace build2 // Customization hooks and helpers. // + using substitution_map = map<string, optional<string>>; // Perform prerequisite search. // @@ -88,6 +95,7 @@ namespace build2 action, const target&, const string& name, optional<uint64_t> flags, + const substitution_map*, const optional<string>& null) const; // Perform variable substitution. Return nullopt if it should be @@ -99,6 +107,7 @@ namespace build2 const string& name, optional<uint64_t> flags, bool strict, + const substitution_map*, const optional<string>& null) const; // Call the above version and do any necessary depdb saving. @@ -110,6 +119,7 @@ namespace build2 const string& name, optional<uint64_t> flags, bool strict, + const substitution_map*, const optional<string>& null) const; // Process a line of input from the specified position performing any @@ -123,6 +133,7 @@ namespace build2 const char* newline, char sym, bool strict, + const substitution_map*, const optional<string>& null) const; // Replace newlines in a multi-line value with the given newline |