aboutsummaryrefslogtreecommitdiff
path: root/build/prerequisite.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build/prerequisite.cxx')
-rw-r--r--build/prerequisite.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/build/prerequisite.cxx b/build/prerequisite.cxx
index d4c8a9c..2437826 100644
--- a/build/prerequisite.cxx
+++ b/build/prerequisite.cxx
@@ -20,9 +20,14 @@ namespace build
ostream&
operator<< (ostream& os, const prerequisite_key& pk)
{
- // Print scope unless the prerequisite's directory is absolute.
+ if (*pk.proj != nullptr)
+ os << **pk.proj << '%';
//
- if (!pk.tk.dir->absolute ())
+ // Don't print scope if we are project-qualified or the
+ // prerequisite's directory is absolute. In both these
+ // cases the scope is not used to resolve it to target.
+ //
+ else if (!pk.tk.dir->absolute ())
{
string s (diag_relative (pk.scope->path (), false));
@@ -36,7 +41,8 @@ namespace build
// prerequisite_set
//
auto prerequisite_set::
- insert (const target_type& tt,
+ insert (const std::string* proj,
+ const target_type& tt,
dir_path dir,
std::string name,
const std::string* ext,
@@ -48,7 +54,7 @@ namespace build
// Find or insert.
//
- auto r (emplace (tt, move (dir), move (name), ext, s));
+ auto r (emplace (proj, tt, move (dir), move (name), ext, s));
prerequisite& p (const_cast<prerequisite&> (*r.first));
// Update extension if the existing prerequisite has it unspecified.