Files
MSYS2-packages/cmake/3.15.0-cygwin-paths.patch
2019-07-18 10:32:59 +03:00

86 lines
2.8 KiB
Diff

--- cmake-3.15.0/Source/kwsys/SystemTools.cxx.orig 2019-07-17 15:07:17.000000000 +0300
+++ cmake-3.15.0/Source/kwsys/SystemTools.cxx 2019-07-18 09:49:25.231363700 +0300
@@ -97,7 +97,7 @@
# if defined(_MSC_VER) && _MSC_VER >= 1800
# define KWSYS_WINDOWS_DEPRECATED_GetVersionEx
# endif
-#elif defined(__CYGWIN__)
+#elif defined(__CYGWIN__) && !defined(__MSYS__)
# include <windows.h>
# undef _WIN32
#endif
@@ -106,7 +106,7 @@
extern char** environ;
#endif
-#ifdef __CYGWIN__
+#if defined(__CYGWIN__) && !defined(__MSYS__)
# include <sys/cygwin.h>
#endif
@@ -467,7 +467,7 @@
std::map<std::string, std::string, SystemToolsPathCaseCmp> PathCaseMap;
std::map<std::string, std::string> EnvMap;
#endif
-#ifdef __CYGWIN__
+#if defined( __CYGWIN__ ) && !defined(__MSYS__)
StringMap Cyg2Win32Map;
#endif
@@ -1298,7 +1298,7 @@
if (path.empty()) {
return false;
}
-#if defined(__CYGWIN__)
+#if defined(__CYGWIN__) && !defined(__MSYS__)
// Convert path to native windows path if possible.
char winpath[MAX_PATH];
if (SystemTools::PathCygwinToWin32(path.c_str(), winpath)) {
@@ -1328,7 +1328,7 @@
if (filename.empty()) {
return false;
}
-#if defined(__CYGWIN__)
+#if defined(__CYGWIN__) && !defined(__MSYS__)
// Convert filename to native windows path if possible.
char winpath[MAX_PATH];
if (SystemTools::PathCygwinToWin32(filename.c_str(), winpath)) {
@@ -1445,7 +1445,7 @@
#endif
}
-#ifdef __CYGWIN__
+#if defined(__CYGWIN__) && !defined(__MSYS__)
bool SystemTools::PathCygwinToWin32(const char* path, char* win32_path)
{
auto itr = SystemTools::Statics->Cyg2Win32Map.find(path);
@@ -4067,7 +4067,7 @@
bool SystemToolsStatic::FileIsFullPath(const char* in_name, size_t len)
{
-#if defined(_WIN32) || defined(__CYGWIN__)
+#if defined(_WIN32) || ( defined(__CYGWIN__) && !defined(__MSYS__))
// On Windows, the name must be at least two characters long.
if (len < 2) {
return false;
@@ -4719,7 +4719,7 @@
// Add some special translation paths for unix. These are not added
// for windows because drive letters need to be maintained. Also,
// there are not sym-links and mount points on windows anyway.
-# if !defined(_WIN32) || defined(__CYGWIN__)
+# if !defined(_WIN32) || (defined(__CYGWIN__) && !defined(__MSYS__))
// The tmp path is frequently a logical path so always keep it:
SystemTools::AddKeepPath("/tmp/");
--- cmake-3.15.0/Source/kwsys/SystemTools.hxx.in.orig 2019-07-17 15:07:17.000000000 +0300
+++ cmake-3.15.0/Source/kwsys/SystemTools.hxx.in 2019-07-18 09:46:35.877466200 +0300
@@ -340,7 +340,7 @@
* caching and calls to cygwin_conv_to_win32_path from Cygwin dll
* for actual translation. Returns true on success, else false.
*/
-#ifdef __CYGWIN__
+#if defined( __CYGWIN__ ) && !defined(__MSYS__)
static bool PathCygwinToWin32(const char* path, char* win32_path);
#endif