From 1c08fae61a1e9a01d56735768ad7f8f3d0b45f41 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 25 Oct 2022 12:16:15 +0300 Subject: Adapt to butl::semantic_version API change --- libbuild2/bin/guess.cxx | 7 +++++-- libbuild2/cc/guess.cxx | 10 +++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'libbuild2') diff --git a/libbuild2/bin/guess.cxx b/libbuild2/bin/guess.cxx index 1e97b7a..e935913 100644 --- a/libbuild2/bin/guess.cxx +++ b/libbuild2/bin/guess.cxx @@ -34,9 +34,12 @@ namespace build2 // Return 0-version if the version is invalid. // static inline semantic_version - parse_version (const string& s, size_t p = 0, const char* bs = ".-+~ ") + parse_version (const string& s, size_t p = 0, + semantic_version::flags f = semantic_version::allow_omit_patch | + semantic_version::allow_build, + const char* bs = ".-+~ ") { - optional v (parse_semantic_version (s, p, bs)); + optional v (parse_semantic_version (s, p, f, bs)); return v ? *v : semantic_version (); } diff --git a/libbuild2/cc/guess.cxx b/libbuild2/cc/guess.cxx index 3cf1d63..23c0b70 100644 --- a/libbuild2/cc/guess.cxx +++ b/libbuild2/cc/guess.cxx @@ -1066,7 +1066,7 @@ namespace build2 // The gcc -v output will have a last line in the form: // - // "gcc version X.Y[.Z][...] ..." + // "gcc version X[.Y[.Z]][...] ..." // // The "version" word can probably be translated. For example: // @@ -1078,6 +1078,7 @@ namespace build2 // gcc version 5.1.0 (Ubuntu 5.1.0-0ubuntu11~14.04.1) // gcc version 6.0.0 20160131 (experimental) (GCC) // gcc version 9.3-win32 20200320 (GCC) + // gcc version 10-win32 20220324 (GCC) // if (cache.empty ()) { @@ -1923,7 +1924,7 @@ namespace build2 // though language words can be translated and even rearranged (see // examples above). // - // "gcc version X.Y[.Z][...]" + // "gcc version X[.Y[.Z]][...]" // compiler_version ver; { @@ -1962,7 +1963,10 @@ namespace build2 // try { - semantic_version v (string (s, b, e - b), ".-+"); + semantic_version v (string (s, b, e - b), + semantic_version::allow_omit_minor | + semantic_version::allow_build, + ".-+"); ver.major = v.major; ver.minor = v.minor; ver.patch = v.patch; -- cgit v1.1