aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/link-rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-01-22 09:35:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-01-22 09:47:40 +0200
commitac03ae75f46196c09cec0e3e45f401dc59faee73 (patch)
tree778ac2220ffa0a01c567f8083527c7428b30d8ff /libbuild2/cc/link-rule.cxx
parent6e91cb7cdb0c4f000a79d20d8578890d56bcdc84 (diff)
Redo bin.lib.version not to require empty key
Diffstat (limited to 'libbuild2/cc/link-rule.cxx')
-rw-r--r--libbuild2/cc/link-rule.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/libbuild2/cc/link-rule.cxx b/libbuild2/cc/link-rule.cxx
index 9c0b018..f500389 100644
--- a/libbuild2/cc/link-rule.cxx
+++ b/libbuild2/cc/link-rule.cxx
@@ -330,7 +330,7 @@ namespace build2
//
string ver;
bool verp (true); // Platform-specific.
- using verion_map = map<string, string>;
+ using verion_map = map<optional<string>, string>;
if (const verion_map* m = cast_null<verion_map> (t["bin.lib.version"]))
{
// First look for the target system.
@@ -347,14 +347,20 @@ namespace build2
// say "all others -- no version".
//
if (i == m->end ())
- i = m->find ("*");
+ i = m->find (string ("*"));
// Finally look for the platform-independent version.
//
if (i == m->end ())
{
verp = false;
- i = m->find ("");
+
+ i = m->find (nullopt);
+
+ // For backwards-compatibility.
+ //
+ if (i == m->end ())
+ i = m->find (string ());
}
// If we didn't find anything, fail. If the bin.lib.version was