aboutsummaryrefslogtreecommitdiff
path: root/build/prerequisite.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-07-15 14:44:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-07-15 14:44:15 +0200
commit243da3993c138d33063f633aa3996a8a710ea396 (patch)
tree6d49a3f964f395773c06e258b6550a4d386fbec3 /build/prerequisite.cxx
parent3c2bc8595e9d6cf6ff35079231c3aab474a38130 (diff)
Implement project-qualified names/prerequisites, two-stage import
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.