aboutsummaryrefslogtreecommitdiff
path: root/build/cli/target.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-07-02 07:08:57 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-07-02 07:08:57 +0200
commitd236d61ee9821abc4e8d3e3928ac2dfa9cb57d98 (patch)
treebc8968a16c7fcd365554b867d8c7dd4da7a575e3 /build/cli/target.cxx
parent455ad2bf70eb0a6e29c8c7179e1c40c18bd8ee2f (diff)
Make few existing file searching optimizations
Diffstat (limited to 'build/cli/target.cxx')
-rw-r--r--build/cli/target.cxx19
1 files changed, 18 insertions, 1 deletions
diff --git a/build/cli/target.cxx b/build/cli/target.cxx
index 95198e1..b77252d 100644
--- a/build/cli/target.cxx
+++ b/build/cli/target.cxx
@@ -46,12 +46,29 @@ namespace build
return file_mtime (h->path ());
}
+ static target*
+ cli_cxx_factory (dir_path d, string n, const string* e)
+ {
+ tracer trace ("cli::cli_cxx::factory");
+
+ // Pre-enter (potential) members as targets. The main purpose
+ // of doing this is to avoid searching for existing files in
+ // src_base if the buildfile mentions one of them explicitly
+ // as a prerequisite.
+ //
+ targets.insert<cxx::hxx> (d, n, trace);
+ targets.insert<cxx::cxx> (d, n, trace);
+ targets.insert<cxx::ixx> (d, n, trace);
+
+ return new cli_cxx (move (d), move (n), e);
+ }
+
const target_type cli_cxx::static_type
{
typeid (cli_cxx),
"cli.cxx",
&mtime_target::static_type,
- &target_factory<cli_cxx>,
+ &cli_cxx_factory,
nullptr,
&search_target,
true // See through default semantics.