aboutsummaryrefslogtreecommitdiff
path: root/build2/target.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-08-29 19:31:16 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-08-29 19:31:16 +0200
commit2720b45ef0ca9fd58c11fd9b4f000e1cf3a0819d (patch)
tree4505f65e4f997889e01d4b69bdf94257223d3dc6 /build2/target.cxx
parent47e89b188ac71627f43e0bb8c47ffe08f6c1b919 (diff)
Implement initial support for library versioning
Currently we only support platform-independent versions that get appended to the library name. The magic incantation is this: lib{foo}: bin.lib.version = @-1.2 This will produce libfoo-1.2.so, libfoo-1.2.dll, etc. In the future we will support things like this: lib{foo}: bin.lib.version = linux@1.2.3 freebsd@1.2 windows@1.2
Diffstat (limited to 'build2/target.cxx')
-rw-r--r--build2/target.cxx17
1 files changed, 10 insertions, 7 deletions
diff --git a/build2/target.cxx b/build2/target.cxx
index 7a33dbc..8541deb 100644
--- a/build2/target.cxx
+++ b/build2/target.cxx
@@ -351,17 +351,20 @@ namespace build2
const path& path_target::
derive_path (const char* de, const char* np, const char* ns)
{
- string n;
+ path_type p (dir);
- if (np != nullptr)
- n += np;
-
- n += name;
+ if (np == nullptr)
+ p /= name;
+ else
+ {
+ p /= np;
+ p += name;
+ }
if (ns != nullptr)
- n += ns;
+ p += ns;
- return derive_path (dir / path_type (move (n)), de);
+ return derive_path (move (p), de);
}
const path& path_target::