diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-07-26 09:30:11 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-07-26 09:30:11 +0200 |
commit | acdcc228c252e2a0a90a8586c5b5c6984332635b (patch) | |
tree | d5d683b623e6f97661a70bd9b915d728b04be189 /build2/target-type.hxx | |
parent | bd9c21a84b62553000fb1e6d23fac4c58febf348 (diff) |
Pass extension supplied by rule to target type default extension function
Also revert the precedence back to target type over rule. But now the target
type is able to customize this logic (see exe{} for a use case).
Diffstat (limited to 'build2/target-type.hxx')
-rw-r--r-- | build2/target-type.hxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/build2/target-type.hxx b/build2/target-type.hxx index ebe60db..408a520 100644 --- a/build2/target-type.hxx +++ b/build2/target-type.hxx @@ -34,12 +34,14 @@ namespace build2 // returns NULL, then it means the default extension for this target could // not be derived. // - // The default extension is used in two (key; there are others) places: + // The default extension is used in two key (there are others) places: // search_existing_file() (called for a prerequisite with the last argument // true) and in target::derive_extension() (called for a target with the // last argument false); see their respective implementations for details. - // Note that the default extension supplied to derive_extension() (e.g., by - // a rule) takes precedence over the one returned by default_extension. + // The third argument is the default extension that is supplied (e.g., by a + // rule) to derive_extension(), if any. The implementation can decide which + // takes precedence, etc (see the exe{} target type for some interesting + // logic). // // If the pattern function is not NULL, then it is used to amend a pattern // or match (reverse is false) and then, if the amendment call returned @@ -55,6 +57,7 @@ namespace build2 const char* (*fixed_extension) (const target_key&); optional<string> (*default_extension) (const target_key&, const scope&, + const char*, bool search); bool (*pattern) (const target_type&, const scope&, string&, bool reverse); |