aboutsummaryrefslogtreecommitdiff
path: root/build/cxx/link.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-12-12 09:00:14 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-12-12 09:00:14 +0200
commitdd4a389117812f0d3b45473d87214d67d0cb4a3a (patch)
tree72cf98c514352b78382dcb9f84c2268a14798a82 /build/cxx/link.cxx
parentc642d8673124b8667123a01a32fa7e83b6301aab (diff)
Add bin.libprefix to override default library prefix
Diffstat (limited to 'build/cxx/link.cxx')
-rw-r--r--build/cxx/link.cxx19
1 files changed, 16 insertions, 3 deletions
diff --git a/build/cxx/link.cxx b/build/cxx/link.cxx
index a00b92e..f5a2e3d 100644
--- a/build/cxx/link.cxx
+++ b/build/cxx/link.cxx
@@ -461,11 +461,24 @@ namespace build
//
if (t.path ().empty ())
{
+ auto l (t["extension"]);
+ const char* e (l ? as<string> (*l).c_str () : nullptr);
+
switch (lt)
{
- case type::e: t.derive_path ("" ); break;
- case type::a: t.derive_path ("a", "lib"); break;
- case type::so: t.derive_path ("so", "lib"); break;
+ case type::e:
+ {
+ t.derive_path (e != nullptr ? e : "");
+ break;
+ }
+ case type::a:
+ case type::so:
+ {
+ auto l (t["bin.libprefix"]);
+ t.derive_path (e != nullptr ? e : (lt == type::a ? "a" : "so"),
+ l ? as<string> (*l).c_str () : "lib");
+ break;
+ }
}
}