summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorOrgad Shaneh <orgads@gmail.com>2021-04-01 17:03:52 (GMT)
committerBrad King <brad.king@kitware.com>2021-04-26 18:27:34 (GMT)
commitddcd1469e8377fe258913a20aa47e65f71f8695b (patch)
treed18b6561383a8f4bc206dac848a15814b74ca642 /Source
parentb3ca4f9ad18220b2f56cd6af7df5cf1e671d39a8 (diff)
downloadCMake-ddcd1469e8377fe258913a20aa47e65f71f8695b.zip
CMake-ddcd1469e8377fe258913a20aa47e65f71f8695b.tar.gz
CMake-ddcd1469e8377fe258913a20aa47e65f71f8695b.tar.bz2
MSYS: Add support for running under MSYS runtime environment
Detect MSYS as CYGWIN, with the required adaptations.
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeLists.txt2
-rw-r--r--Source/Checks/cm_cxx_features.cmake4
-rw-r--r--Source/Modules/FindLibUUID.cmake9
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx2
-rw-r--r--Source/cmSystemTools.cxx6
5 files changed, 18 insertions, 5 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 938745c..c19c154 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -44,7 +44,7 @@ endif()
if(NOT CMake_DEFAULT_RECURSION_LIMIT)
if(DEFINED ENV{DASHBOARD_TEST_FROM_CTEST})
set(CMake_DEFAULT_RECURSION_LIMIT 100)
- elseif(MINGW)
+ elseif(MINGW OR MSYS)
set(CMake_DEFAULT_RECURSION_LIMIT 400)
elseif(WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "IntelLLVM")
set(CMake_DEFAULT_RECURSION_LIMIT 600)
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake
index 7917d41..f20572e 100644
--- a/Source/Checks/cm_cxx_features.cmake
+++ b/Source/Checks/cm_cxx_features.cmake
@@ -80,7 +80,9 @@ if(CMake_HAVE_CXX_MAKE_UNIQUE)
set(CMake_HAVE_CXX_UNIQUE_PTR 1)
endif()
cm_check_cxx_feature(unique_ptr)
-if (NOT CMAKE_CXX_STANDARD LESS "17")
+if (NOT CMAKE_CXX_STANDARD LESS "17"
+ AND NOT MSYS # FIXME: RunCMake.cmake_path cases crash with MSYS std::filesystem
+ )
if (NOT CMAKE_CROSSCOMPILING OR CMAKE_CROSSCOMPILING_EMULATOR)
cm_check_cxx_feature(filesystem TRY_RUN)
else()
diff --git a/Source/Modules/FindLibUUID.cmake b/Source/Modules/FindLibUUID.cmake
index 17f11c1..ca5b61d 100644
--- a/Source/Modules/FindLibUUID.cmake
+++ b/Source/Modules/FindLibUUID.cmake
@@ -40,7 +40,14 @@ They may be set by end users to point at LibUUID components.
#]=======================================================================]
#-----------------------------------------------------------------------------
-if(CYGWIN)
+if(MSYS)
+ # Note: on current version of MSYS2, linking to libuuid.dll.a doesn't
+ # import the right symbols sometimes. Fix this by linking directly
+ # to the DLL that provides the symbols, instead.
+ find_library(LibUUID_LIBRARY
+ NAMES msys-uuid-1.dll
+ )
+elseif(CYGWIN)
# Note: on current version of Cygwin, linking to libuuid.dll.a doesn't
# import the right symbols sometimes. Fix this by linking directly
# to the DLL that provides the symbols, instead.
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index ccfd727..5fbbef7 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -655,7 +655,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
xml.EndElement(); // extension
} else {
std::string systemName = mf->GetSafeDefinition("CMAKE_SYSTEM_NAME");
- if (systemName == "CYGWIN") {
+ if (systemName == "CYGWIN" || systemName == "MSYS") {
xml.StartElement("extension");
xml.Attribute("id", "org.eclipse.cdt.core.Cygwin_PE");
xml.Attribute("point", "org.eclipse.cdt.core.BinaryParser");
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 5382fac..aad5533 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -3239,10 +3239,14 @@ cm::string_view cmSystemTools::GetSystemName()
systemName = "kFreeBSD";
}
- // fix for CYGWIN which has windows version in it
+ // 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 "";