aboutsummaryrefslogtreecommitdiff
path: root/build2/target.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-07-15 09:32:04 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-07-15 09:32:04 +0200
commit70ec3eba9ef98e018e0491b559874c41734193c7 (patch)
tree5cee631331bf3df74b0ab6986738ddd49f296558 /build2/target.cxx
parentfd641f3f10499d4368822b0776ded4c47f152ae7 (diff)
Make .pdb ad hoc group member, install
Diffstat (limited to 'build2/target.cxx')
-rw-r--r--build2/target.cxx54
1 files changed, 34 insertions, 20 deletions
diff --git a/build2/target.cxx b/build2/target.cxx
index deeee4f..a8fae39 100644
--- a/build2/target.cxx
+++ b/build2/target.cxx
@@ -307,21 +307,10 @@ namespace build2
// path_target
//
- void path_target::
- derive_path (const char* de, const char* np, const char* ns)
+ const string& path_target::
+ derive_extension (const char* de)
{
- string n;
-
- if (np != nullptr)
- n += np;
-
- n += name;
-
- if (ns != nullptr)
- n += ns;
-
- // Update the extension. See also search_existing_file() if updating
- // anything here.
+ // See also search_existing_file() if updating anything here.
//
assert (de == nullptr || type ().extension != nullptr);
@@ -344,23 +333,48 @@ namespace build2
}
}
- // Add the extension.
+ return *ext;
+ }
+
+ const path& path_target::
+ derive_path (const char* de, const char* np, const char* ns)
+ {
+ string n;
+
+ if (np != nullptr)
+ n += np;
+
+ n += name;
+
+ if (ns != nullptr)
+ n += ns;
+
+ return derive_path (dir / path_type (move (n)), de);
+ }
+
+ const path& path_target::
+ derive_path (path_type p, const char* de)
+ {
+ // Derive and add the extension if any.
//
+ derive_extension (de);
+
if (!ext->empty ())
{
- n += '.';
- n += *ext;
+ p += '.';
+ p += *ext;
}
- path_type p (dir / path_type (move (n)));
const path_type& ep (path ());
if (ep.empty ())
- path (p);
+ path (move (p));
else if (p != ep)
fail << "path mismatch for target " << *this <<
- info << "assigned '" << ep << "'" <<
+ info << "existing '" << ep << "'" <<
info << "derived '" << p << "'";
+
+ return path ();
}
// file_target