aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbutl/target-triplet.cxx11
-rw-r--r--libbutl/target-triplet.mxx3
-rw-r--r--tests/target-triplet/driver.cxx4
3 files changed, 14 insertions, 4 deletions
diff --git a/libbutl/target-triplet.cxx b/libbutl/target-triplet.cxx
index 88a4262..dfd93b4 100644
--- a/libbutl/target-triplet.cxx
+++ b/libbutl/target-triplet.cxx
@@ -83,7 +83,8 @@ namespace butl
{
// See if this is one of the well-known non-vendors.
//
- if (s.compare (f, n, "linux") == 0 ||
+ if (s.compare (f, n, "linux") == 0 ||
+ s.compare (f, n, "windows") == 0 ||
s.compare (f, n, "kfreebsd") == 0)
{
l = f - 1;
@@ -134,9 +135,13 @@ namespace butl
class_ = "linux";
else if (vendor == "apple" && system == "darwin")
class_ = "macos";
- else if (system == "freebsd" || system == "openbsd" || system == "netbsd")
+ else if (system == "freebsd" ||
+ system == "openbsd" ||
+ system == "netbsd")
class_ = "bsd";
- else if (system.compare (0, 5, "win32") == 0 || system == "mingw32")
+ else if (system.compare (0, 5, "win32") == 0 ||
+ system.compare (0, 7, "windows") == 0 ||
+ system == "mingw32")
class_ = "windows";
else
class_ = "other";
diff --git a/libbutl/target-triplet.mxx b/libbutl/target-triplet.mxx
index 0b2c40a..b0b7291 100644
--- a/libbutl/target-triplet.mxx
+++ b/libbutl/target-triplet.mxx
@@ -92,6 +92,7 @@ LIBBUTL_MODEXPORT namespace butl
// 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
//
// Similar to version splitting, for certain commonly-used targets we also
// derive the "target class" which can be used as a shorthand, more
@@ -102,7 +103,7 @@ LIBBUTL_MODEXPORT namespace butl
// linux *-*-linux-*
// macos *-apple-darwin*
// bsd *-*-(freebsd|openbsd|netbsd)*
- // windows *-*-win32-* | *-*-mingw32
+ // windows *-*-win32-* | *-*-windows-* | *-*-mingw32
//
// References:
//
diff --git a/tests/target-triplet/driver.cxx b/tests/target-triplet/driver.cxx
index 5e61a46..78329bd 100644
--- a/tests/target-triplet/driver.cxx
+++ b/tests/target-triplet/driver.cxx
@@ -121,6 +121,10 @@ main ()
assert (test ("x86_64-microsoft-win32-msvc14.0",
"x86_64-microsoft-win32-msvc14.0",
"x86_64", "microsoft", "win32-msvc", "14.0", "windows"));
+
+ assert (test ("x86_64-pc-windows-msvc",
+ "x86_64-windows-msvc",
+ "x86_64", "", "windows-msvc", "", "windows"));
}
static bool