diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-17 12:53:37 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-17 12:53:37 +0200 |
commit | dc46fa754baa446d5428ba38db0d637a17b91c57 (patch) | |
tree | 55d0cac384babc4fbbd27bb1cd8837fca6187017 /build2/cc/link.cxx | |
parent | 136dc68a2704d50ccc7dee644e67f86a31b34f49 (diff) |
Add support for config.bin.{lib,exe}.{prefix,suffix}
This replaces the bin.libprefix functionality.
Diffstat (limited to 'build2/cc/link.cxx')
-rw-r--r-- | build2/cc/link.cxx | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/build2/cc/link.cxx b/build2/cc/link.cxx index 4bebc6f..df1fa7e 100644 --- a/build2/cc/link.cxx +++ b/build2/cc/link.cxx @@ -651,8 +651,9 @@ namespace build2 // if (t.path ().empty ()) { - const char* p (nullptr); - const char* e (nullptr); + const char* p (nullptr); // Prefix. + const char* s (nullptr); // Suffix. + const char* e (nullptr); // Extension. switch (lt) { @@ -663,6 +664,9 @@ namespace build2 else e = ""; + if (auto l = t["bin.exe.prefix"]) p = cast<string> (l).c_str (); + if (auto l = t["bin.exe.suffix"]) s = cast<string> (l).c_str (); + break; } case otype::a: @@ -681,8 +685,8 @@ namespace build2 e = "a"; } - if (auto l = t["bin.libprefix"]) - p = cast<string> (l).c_str (); + if (auto l = t["bin.lib.prefix"]) p = cast<string> (l).c_str (); + if (auto l = t["bin.lib.suffix"]) s = cast<string> (l).c_str (); break; } @@ -710,14 +714,14 @@ namespace build2 e = "so"; } - if (auto l = t["bin.libprefix"]) - p = cast<string> (l).c_str (); + if (auto l = t["bin.lib.prefix"]) p = cast<string> (l).c_str (); + if (auto l = t["bin.lib.suffix"]) s = cast<string> (l).c_str (); break; } } - t.derive_path (e, p); + t.derive_path (e, p, s); } // Add ad hoc group members. |