From bcfcc38538af8bb896551c9e5730767807ad7a67 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 7 Feb 2017 10:05:47 +0200 Subject: Tighten code that operates during both search/match and execute --- build2/file.ixx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'build2/file.ixx') 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); + } } -- cgit v1.1