diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-01-27 13:59:51 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-01-27 13:59:51 +0200 |
commit | a5949f9e974171144dba84771a9f305f9e1dcc3f (patch) | |
tree | 1e70c60d0c9daf4065e1163426c65b512d70c0c6 /build2/target-type | |
parent | bb171dd3fa145b15a6defd122b15be6822806e2b (diff) |
Rework default extension derivation, again
Diffstat (limited to 'build2/target-type')
-rw-r--r-- | build2/target-type | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/build2/target-type b/build2/target-type index a831670..2659e3d 100644 --- a/build2/target-type +++ b/build2/target-type @@ -28,15 +28,20 @@ namespace build2 // If the extension derivation function is NULL, then it means this target // type does not use extensions. Note that this is relied upon when deciding // whether to print the extension; if the target does use extensions but the - // defaults should not or cannot (logically) be obtained, then use - // target_extension_{fail,assert}(), respectively. + // defaults could not (and its ok), could not (and its not ok), or should not + // (logically) be obtained, then use target_extension_{null,fail,assert}(), + // respectively. If the extension function returns NULL, then that means the + // default extension for this target could not be derived. + // + // The extension function is used in two places: search_existing_file() and + // in target::derive_path(); see their implementations for details. // struct target_type { const char* name; const target_type* base; target* (*factory) (const target_type&, dir_path, string, const string*); - const string& (*extension) (const target_key&, scope&); + const string* (*extension) (const target_key&, scope&); void (*print) (ostream&, const target_key&); target* (*search) (const prerequisite_key&); bool see_through; // A group with the default "see through" semantics. |