aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-12-06 10:37:08 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-12-06 10:37:08 +0200
commitdf2ca2c72fd7d267e27c1643c5d6ac9fa3b6114a (patch)
treec2743eebb1bb0ee0dbb4846bcec8666ee057390c
parent5937468ae094d4189358cb96c5db2ebe2f4d0b2a (diff)
Handle system version in Clang's *-windows-msvc target triplet
-rw-r--r--libbutl/target-triplet.cxx17
-rw-r--r--libbutl/target-triplet.mxx29
-rw-r--r--tests/target-triplet/driver.cxx8
3 files changed, 32 insertions, 22 deletions
diff --git a/libbutl/target-triplet.cxx b/libbutl/target-triplet.cxx
index dfd93b4..0b7247e 100644
--- a/libbutl/target-triplet.cxx
+++ b/libbutl/target-triplet.cxx
@@ -116,14 +116,15 @@ namespace butl
// Extract VERSION for some recognized systems.
//
string::size_type v (0);
- if (system.compare (0, (v = 6), "darwin") == 0 ||
- system.compare (0, (v = 7), "freebsd") == 0 ||
- system.compare (0, (v = 7), "openbsd") == 0 ||
- system.compare (0, (v = 6), "netbsd") == 0 ||
- system.compare (0, (v = 7), "solaris") == 0 ||
- system.compare (0, (v = 3), "aix") == 0 ||
- system.compare (0, (v = 4), "hpux") == 0 ||
- system.compare (0, (v = 10), "win32-msvc") == 0)
+ if (system.compare (0, (v = 6), "darwin") == 0 ||
+ system.compare (0, (v = 7), "freebsd") == 0 ||
+ system.compare (0, (v = 7), "openbsd") == 0 ||
+ system.compare (0, (v = 6), "netbsd") == 0 ||
+ system.compare (0, (v = 7), "solaris") == 0 ||
+ system.compare (0, (v = 3), "aix") == 0 ||
+ system.compare (0, (v = 4), "hpux") == 0 ||
+ system.compare (0, (v = 10), "win32-msvc") == 0 ||
+ system.compare (0, (v = 12), "windows-msvc") == 0)
{
version.assign (system, v, string::npos);
system.resize (system.size () - version.size ());
diff --git a/libbutl/target-triplet.mxx b/libbutl/target-triplet.mxx
index b0b7291..39a62d0 100644
--- a/libbutl/target-triplet.mxx
+++ b/libbutl/target-triplet.mxx
@@ -79,20 +79,21 @@ LIBBUTL_MODEXPORT namespace butl
//
// Some examples of canonicalization and splitting:
//
- // x86_64-apple-darwin14.5.0 x86_64 apple darwin 14.5.0
- // x86_64-unknown-freebsd10.2 x86_64 freebsd 10.2
- // i686-elf i686 elf
- // arm-eabi arm eabi
- // arm-none-eabi arm eabi
- // arm-none-linux-gnueabi arm linux-gnueabi
- // arm-softfloat-linux-gnu arm softfloat linux-gnu
- // i686-pc-mingw32 i686 mingw32
- // i686-w64-mingw32 i686 w64 mingw32
- // i686-lfs-linux-gnu i686 lfs linux-gnu
- // x86_64-unknown-linux-gnu x86_64 linux-gnu
- // x86_64-linux-gnux32 x86_64 linux-gnux32
- // x86_64-microsoft-win32-msvc14.0 x86_64 microsoft win32-msvc 14.0
- // x86_64-pc-windows-msvc x86_64 windows-msvc
+ // x86_64-apple-darwin14.5.0 x86_64 apple darwin 14.5.0
+ // x86_64-unknown-freebsd10.2 x86_64 freebsd 10.2
+ // i686-elf i686 elf
+ // arm-eabi arm eabi
+ // arm-none-eabi arm eabi
+ // arm-none-linux-gnueabi arm linux-gnueabi
+ // arm-softfloat-linux-gnu arm softfloat linux-gnu
+ // i686-pc-mingw32 i686 mingw32
+ // i686-w64-mingw32 i686 w64 mingw32
+ // i686-lfs-linux-gnu i686 lfs linux-gnu
+ // x86_64-unknown-linux-gnu x86_64 linux-gnu
+ // x86_64-linux-gnux32 x86_64 linux-gnux32
+ // x86_64-microsoft-win32-msvc14.0 x86_64 microsoft win32-msvc 14.0
+ // x86_64-pc-windows-msvc x86_64 windows-msvc
+ // x86_64-pc-windows-msvc19.11.25547 x86_64 windows-msvc 19.11.25547
//
// Similar to version splitting, for certain commonly-used targets we also
// derive the "target class" which can be used as a shorthand, more
diff --git a/tests/target-triplet/driver.cxx b/tests/target-triplet/driver.cxx
index 78329bd..1bed65b 100644
--- a/tests/target-triplet/driver.cxx
+++ b/tests/target-triplet/driver.cxx
@@ -122,9 +122,17 @@ main ()
"x86_64-microsoft-win32-msvc14.0",
"x86_64", "microsoft", "win32-msvc", "14.0", "windows"));
+ assert (test ("x86_64-windows-msvc",
+ "x86_64-windows-msvc",
+ "x86_64", "", "windows-msvc", "", "windows"));
+
assert (test ("x86_64-pc-windows-msvc",
"x86_64-windows-msvc",
"x86_64", "", "windows-msvc", "", "windows"));
+
+ assert (test ("x86_64-pc-windows-msvc19.11.25547",
+ "x86_64-windows-msvc19.11.25547",
+ "x86_64", "", "windows-msvc", "19.11.25547", "windows"));
}
static bool