summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-05-29 14:07:29 -0400
committerBrad King <brad.king@kitware.com>2018-05-29 14:07:29 -0400
commit058ea79ff21c6d5f49715ef9548bf0378f49feb8 (patch)
treefc93d648b7f52ce91ff82b2574cce5a1a6ce3593
parent519427e32c1f914b2a4184553c18fccd4614209d (diff)
parent83630d491888705dc650f2ae62de9943181b50df (diff)
downloadcmake-058ea79ff21c6d5f49715ef9548bf0378f49feb8.tar.gz
Merge branch 'revert-windows_symlinks' into release-3.11
Merge-request: !2114
-rw-r--r--Help/release/3.11.rst7
-rw-r--r--Source/cmSystemTools.cxx10
-rw-r--r--Source/cmSystemTools.h10
-rw-r--r--Source/cmTimestamp.cxx3
4 files changed, 22 insertions, 8 deletions
diff --git a/Help/release/3.11.rst b/Help/release/3.11.rst
index 971b3e2ba0..214da0dba9 100644
--- a/Help/release/3.11.rst
+++ b/Help/release/3.11.rst
@@ -298,3 +298,10 @@ Changes made since CMake 3.11.0 include the following.
:prop_sf:`SKIP_AUTOUIC` on their generated files. These files never
need to be processed by moc or uic, and we must say so explicitly to
account for policy :policy:`CMP0071`.
+
+3.11.3
+------
+
+* CMake 3.11.0 introduced support for resolving symbolic links on
+ Windows in code paths that typically do so on UNIX. This has been
+ reverted due to breakage on ``subst`` drives.
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index eeb73c3ee4..6f326de515 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -949,10 +949,12 @@ cmSystemTools::WindowsFileRetry cmSystemTools::GetWindowsFileRetry()
}
return retry;
}
+#endif
-std::string cmSystemTools::GetRealPath(const std::string& path,
- std::string* errorMessage)
+std::string cmSystemTools::GetRealPathResolvingWindowsSubst(
+ const std::string& path, std::string* errorMessage)
{
+#ifdef _WIN32
// uv_fs_realpath uses Windows Vista API so fallback to kwsys if not found
std::string resolved_path;
uv_fs_t req;
@@ -981,8 +983,10 @@ std::string cmSystemTools::GetRealPath(const std::string& path,
resolved_path = path;
}
return resolved_path;
-}
+#else
+ return cmsys::SystemTools::GetRealPath(path, errorMessage);
#endif
+}
void cmSystemTools::InitializeLibUV()
{
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index a53afded7e..4390c863e2 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -500,12 +500,14 @@ public:
unsigned int Delay;
};
static WindowsFileRetry GetWindowsFileRetry();
-
- /** Get the real path for a given path, removing all symlinks. */
- static std::string GetRealPath(const std::string& path,
- std::string* errorMessage = 0);
#endif
+ /** Get the real path for a given path, removing all symlinks.
+ This variant of GetRealPath also works on Windows but will
+ resolve subst drives too. */
+ static std::string GetRealPathResolvingWindowsSubst(
+ const std::string& path, std::string* errorMessage = nullptr);
+
/** Perform one-time initialization of libuv. */
static void InitializeLibUV();
diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx
index f1e92839d0..14cf6e9640 100644
--- a/Source/cmTimestamp.cxx
+++ b/Source/cmTimestamp.cxx
@@ -33,7 +33,8 @@ std::string cmTimestamp::FileModificationTime(const char* path,
const std::string& formatString,
bool utcFlag)
{
- std::string real_path = cmSystemTools::GetRealPath(path);
+ std::string real_path =
+ cmSystemTools::GetRealPathResolvingWindowsSubst(path);
if (!cmsys::SystemTools::FileExists(real_path)) {
return std::string();