mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-14 13:30:29 -05:00
MSYS,CYGWIN: Hard-code host system names when built for these runtimes
When CMake is built against the MSYS runtime library, `uname()` returns a name that depends on the `MSYSTEM` environment variable. Previously we truncated `MSYS_...` to just `MSYS`, but outside `MSYSTEM=MSYS` environments, names like `MINGW64_NT-10.0-22000` were reported. The latter causes CMake to report an unsupported-platform error, which users report as an issue when the real problem is that they should be using a `MSYSTEM=MSYS` environment or a CMake that is not built against the MSYS runtime. For our purposes, if CMake is built against the MSYS runtime, the host platform is always `MSYS`. Similarly for `CYGWIN`.
This commit is contained in:
@@ -3697,6 +3697,10 @@ cm::string_view cmSystemTools::GetSystemName()
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
return "Windows";
|
||||
#elif defined(__MSYS__)
|
||||
return "MSYS";
|
||||
#elif defined(__CYGWIN__)
|
||||
return "CYGWIN";
|
||||
#elif defined(__ANDROID__)
|
||||
return "Android";
|
||||
#else
|
||||
@@ -3725,15 +3729,6 @@ cm::string_view cmSystemTools::GetSystemName()
|
||||
if (systemName.find("kFreeBSD") != cm::string_view::npos) {
|
||||
systemName = "kFreeBSD";
|
||||
}
|
||||
|
||||
// fix for CYGWIN and MSYS which have windows version in them
|
||||
if (systemName.find("CYGWIN") != cm::string_view::npos) {
|
||||
systemName = "CYGWIN";
|
||||
}
|
||||
|
||||
if (systemName.find("MSYS") != cm::string_view::npos) {
|
||||
systemName = "MSYS";
|
||||
}
|
||||
return systemName;
|
||||
}
|
||||
return "";
|
||||
|
||||
Reference in New Issue
Block a user