From 2720b45ef0ca9fd58c11fd9b4f000e1cf3a0819d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 29 Aug 2016 19:31:16 +0200 Subject: 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 --- build2/target.cxx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'build2/target.cxx') 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:: -- cgit v1.1