aboutsummaryrefslogtreecommitdiff
path: root/build2/file.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-02-07 10:05:47 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-02-13 12:42:42 +0200
commitbcfcc38538af8bb896551c9e5730767807ad7a67 (patch)
tree722e71364bf6d8080ca61d8b2d02879520d90765 /build2/file.ixx
parent7b9eb752cad04aaadc4552d0f26d307b04af1869 (diff)
Tighten code that operates during both search/match and execute
Diffstat (limited to 'build2/file.ixx')
-rw-r--r--build2/file.ixx17
1 files changed, 17 insertions, 0 deletions
diff --git a/build2/file.ixx b/build2/file.ixx
index e12654c..be43857 100644
--- a/build2/file.ixx
+++ b/build2/file.ixx
@@ -9,4 +9,21 @@ namespace build2
{
return source_once (root, base, bf, base);
}
+
+ target*
+ import (const prerequisite_key&, bool existing);
+
+ inline target&
+ import (const prerequisite_key& pk)
+ {
+ assert (phase == run_phase::search_match);
+ return *import (pk, false);
+ }
+
+ inline const target*
+ import_existing (const prerequisite_key& pk)
+ {
+ assert (phase == run_phase::search_match || phase == run_phase::execute);
+ return import (pk, true);
+ }
}