aboutsummaryrefslogtreecommitdiff
path: root/build2/target.txx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-01-19 16:50:40 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-01-19 16:50:40 +0200
commit5164c843513212ab1ac1f721c4de04b6a865eb0c (patch)
tree1c6b2f440bd6dcd41fed60e76095bae2bf4e9e54 /build2/target.txx
parent5607313a91e5ca0113b1f8b9acfd02c1fb105346 (diff)
Get rid of extension_pool
Diffstat (limited to 'build2/target.txx')
-rw-r--r--build2/target.txx12
1 files changed, 5 insertions, 7 deletions
diff --git a/build2/target.txx b/build2/target.txx
index bc63c75..66acfb8 100644
--- a/build2/target.txx
+++ b/build2/target.txx
@@ -3,7 +3,6 @@
// license : MIT; see accompanying LICENSE file
#include <build2/scope>
-#include <build2/context> // extension_pool
#include <build2/diagnostics>
#include <build2/prerequisite>
@@ -34,14 +33,14 @@ namespace build2
//
//
template <const char* ext>
- const string*
+ optional<string>
target_extension_fix (const target_key&, scope&, bool)
{
- return &extension_pool.find (ext);
+ return string (ext);
}
template <const char* var, const char* def>
- const string*
+ optional<string>
target_extension_var (const target_key& tk, scope& s, bool)
{
// Include target type/pattern-specific variables.
@@ -51,10 +50,9 @@ namespace build2
// Help the user here and strip leading '.' from the extension.
//
const string& e (cast<string> (l));
- return &extension_pool.find (
- !e.empty () && e.front () == '.' ? string (e, 1) : e);
+ return !e.empty () && e.front () == '.' ? string (e, 1) : e;
}
- return def != nullptr ? &extension_pool.find (def) : nullptr;
+ return def != nullptr ? optional<string> (def) : nullopt;
}
}