aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/target-type.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-05-21 15:11:04 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-05-28 10:10:44 +0200
commite1f472e471533330db05a42d5bcd4e99b211da0c (patch)
treecdaa6a1de2a69965a347d6132a63c5b12d051c68 /libbuild2/target-type.hxx
parent7d0cbd244d218bca8b806c283a5ae095f221b324 (diff)
Clean default target type extension logic
Diffstat (limited to 'libbuild2/target-type.hxx')
-rw-r--r--libbuild2/target-type.hxx21
1 files changed, 17 insertions, 4 deletions
diff --git a/libbuild2/target-type.hxx b/libbuild2/target-type.hxx
index 913432e..5798766 100644
--- a/libbuild2/target-type.hxx
+++ b/libbuild2/target-type.hxx
@@ -22,10 +22,23 @@ namespace build2
// type does not use extensions. Note that this is relied upon when deciding
// whether to print the extension.
//
- // The fixed extension function should return the fixed extension (which can
- // point to the key's ext member; note that for performance reasons we
- // currently only verify the explicitly specified extension on target
- // insersion -- see target_key comparison for details).
+ // If the fixed extension function is specified, then it means that this
+ // target type has a fixed extension (including the no-extension case) and
+ // this function should return such a fixed extension (which, if overriding
+ // by the user is allowed, can point to the key's ext member; note that for
+ // performance reasons we currently only verify the explicitly specified
+ // extension on target insersion -- see target_key comparison for details).
+ // It is called eraly, during the target insertion, in contrast to the
+ // default extension function described below (you would specify one or the
+ // other).
+ //
+ // Note that the fixed no-extension case that allows overriding by the user
+ // is used to implement the "if extension is not specified by the user then
+ // there is no extension" semantics of the file{} and similar target types.
+ // For such cases the target_extension_none() function should be used (we
+ // compare to it's address to detect target types with such semantics).
+ // Similarly, for cases where the user must specify the extension explicitly
+ // (e.g., man{}), use target_extension_must().
//
// The root scope argument to the fixed extension function may be NULL which
// means the root scope is not known. A target type that relies on this must