diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2020-02-24 14:14:45 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2020-02-24 14:14:45 +0200 |
commit | b19fe69cdd0d32dc45f166447170bc5c9c54ac5a (patch) | |
tree | 8ea63449272db53accb4d724e38589ce52c68622 /libbuild2/bin/guess.cxx | |
parent | 4a47a60f958339d5ccf479481b0d4e998ee0d448 (diff) |
Extract version for lld-link
Diffstat (limited to 'libbuild2/bin/guess.cxx')
-rw-r--r-- | libbuild2/bin/guess.cxx | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/libbuild2/bin/guess.cxx b/libbuild2/bin/guess.cxx index 3329cc5..63f5db5 100644 --- a/libbuild2/bin/guess.cxx +++ b/libbuild2/bin/guess.cxx @@ -16,12 +16,16 @@ namespace build2 string id; string signature; string checksum; - semantic_version version; + optional<semantic_version> version; guess_result () = default; + guess_result (string&& i, string&& s, semantic_version&& v) : id (move (i)), signature (move (s)), version (move (v)) {} + guess_result (string&& i, string&& s, optional<semantic_version>&& v) + : id (move (i)), signature (move (s)), version (move (v)) {} + bool empty () const {return id.empty ();} }; @@ -288,7 +292,7 @@ namespace build2 move (arr.id), move (arr.signature), move (arr.checksum), - move (arr.version), + move (*arr.version), move (rlp), move (rlr.id), @@ -325,7 +329,7 @@ namespace build2 auto f = [&ld] (string& l, bool) -> guess_result { string id; - semantic_version ver; + optional<semantic_version> ver; // Microsoft link.exe output starts with "Microsoft (R) ". // @@ -337,6 +341,8 @@ namespace build2 // else if (l.compare (0, 4, "LLD ") == 0) { + ver = parse_version (l, 4); + // The only way to distinguish between various LLD drivers is via // their name. Handle potential prefixes (say a target) and // suffixes (say a version). @@ -446,7 +452,11 @@ namespace build2 fail << "unable to guess " << ld << " signature"; return ld_info { - move (pp), move (r.id), move (r.signature), move (r.checksum)}; + move (pp), + move (r.id), + move (r.signature), + move (r.checksum), + move (r.version)}; } rc_info |