summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt6
-rw-r--r--Source/cmSystemTools.cxx18
-rw-r--r--Tests/RunCMake/CommandLine/E_create_hardlink-no-directory-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/E_create_hardlink-unresolved-symlink-prereq-check.cmake2
-rw-r--r--Tests/RunCMake/CommandLine/E_create_symlink-broken-create-check.cmake2
-rw-r--r--Tests/RunCMake/CommandLine/E_create_symlink-broken-replace-check.cmake2
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake4
7 files changed, 26 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4f03c39cbf..44b433ac8f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -644,7 +644,11 @@ macro (CMAKE_BUILD_UTILITIES)
#---------------------------------------------------------------------
# Build libuv library.
if(CMAKE_USE_SYSTEM_LIBUV)
- find_package(LibUV 1.10.0)
+ if(WIN32)
+ find_package(LibUV 1.38.0)
+ else()
+ find_package(LibUV 1.10.0)
+ endif()
if(NOT LIBUV_FOUND)
message(FATAL_ERROR
"CMAKE_USE_SYSTEM_LIBUV is ON but a libuv is not found!")
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 9e46dab2a3..ab42810feb 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -3173,9 +3173,15 @@ cmsys::Status cmSystemTools::CreateSymlink(std::string const& origName,
flags, nullptr);
cmsys::Status status;
if (err) {
+#if defined(_WIN32)
+ status = cmsys::Status::Windows(uv_fs_get_system_error(&req));
+#elif UV_VERSION_MAJOR > 1 || (UV_VERSION_MAJOR == 1 && UV_VERSION_MINOR >= 38)
+ status = cmsys::Status::POSIX(uv_fs_get_system_error(&req));
+#else
status = cmsys::Status::POSIX(-err);
- std::string e =
- "failed to create symbolic link '" + newName + "': " + uv_strerror(err);
+#endif
+ std::string e = cmStrCat("failed to create symbolic link '", newName,
+ "': ", status.GetString());
if (errorMessage) {
*errorMessage = std::move(e);
} else {
@@ -3194,9 +3200,15 @@ cmsys::Status cmSystemTools::CreateLink(std::string const& origName,
uv_fs_link(nullptr, &req, origName.c_str(), newName.c_str(), nullptr);
cmsys::Status status;
if (err) {
+#if defined(_WIN32)
+ status = cmsys::Status::Windows(uv_fs_get_system_error(&req));
+#elif UV_VERSION_MAJOR > 1 || (UV_VERSION_MAJOR == 1 && UV_VERSION_MINOR >= 38)
+ status = cmsys::Status::POSIX(uv_fs_get_system_error(&req));
+#else
status = cmsys::Status::POSIX(-err);
+#endif
std::string e =
- "failed to create link '" + newName + "': " + uv_strerror(err);
+ cmStrCat("failed to create link '", newName, "': ", status.GetString());
if (errorMessage) {
*errorMessage = std::move(e);
} else {
diff --git a/Tests/RunCMake/CommandLine/E_create_hardlink-no-directory-stderr.txt b/Tests/RunCMake/CommandLine/E_create_hardlink-no-directory-stderr.txt
index 21e60eec02..63a10d8355 100644
--- a/Tests/RunCMake/CommandLine/E_create_hardlink-no-directory-stderr.txt
+++ b/Tests/RunCMake/CommandLine/E_create_hardlink-no-directory-stderr.txt
@@ -1 +1 @@
-^CMake Error: failed to create link .* no such file or directory
+^CMake Error: failed to create link '[^']+': [A-Za-z]
diff --git a/Tests/RunCMake/CommandLine/E_create_hardlink-unresolved-symlink-prereq-check.cmake b/Tests/RunCMake/CommandLine/E_create_hardlink-unresolved-symlink-prereq-check.cmake
index 5b97aecc0d..d92554af4d 100644
--- a/Tests/RunCMake/CommandLine/E_create_hardlink-unresolved-symlink-prereq-check.cmake
+++ b/Tests/RunCMake/CommandLine/E_create_hardlink-unresolved-symlink-prereq-check.cmake
@@ -1,3 +1,3 @@
-if(${actual_stderr_var} MATCHES "operation not permitted")
+if(${actual_stderr_var} MATCHES "A required privilege is not held by the client")
unset(msg)
endif()
diff --git a/Tests/RunCMake/CommandLine/E_create_symlink-broken-create-check.cmake b/Tests/RunCMake/CommandLine/E_create_symlink-broken-create-check.cmake
index 5df5f2fb70..43573bfe9f 100644
--- a/Tests/RunCMake/CommandLine/E_create_symlink-broken-create-check.cmake
+++ b/Tests/RunCMake/CommandLine/E_create_symlink-broken-create-check.cmake
@@ -1,4 +1,4 @@
-if(${actual_stderr_var} MATCHES "operation not permitted")
+if(${actual_stderr_var} MATCHES "A required privilege is not held by the client")
unset(msg)
else()
if(NOT IS_SYMLINK ${RunCMake_TEST_BINARY_DIR}/L)
diff --git a/Tests/RunCMake/CommandLine/E_create_symlink-broken-replace-check.cmake b/Tests/RunCMake/CommandLine/E_create_symlink-broken-replace-check.cmake
index d37df01690..639c2237ee 100644
--- a/Tests/RunCMake/CommandLine/E_create_symlink-broken-replace-check.cmake
+++ b/Tests/RunCMake/CommandLine/E_create_symlink-broken-replace-check.cmake
@@ -1,4 +1,4 @@
-if(${actual_stderr_var} MATCHES "operation not permitted")
+if(${actual_stderr_var} MATCHES "A required privilege is not held by the client")
unset(msg)
else()
if(NOT IS_DIRECTORY ${RunCMake_TEST_BINARY_DIR}/L)
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 78c3508713..a1edbd0f2b 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -359,7 +359,7 @@ run_cmake_command(E_create_symlink-missing-dir
# These tests are special on Windows since it will only fail if the user
# running the test does not have the priveldge to create symlinks. If this
# happens we clear the msg in the -check.cmake and say that the test passes
-set(RunCMake_DEFAULT_stderr "(operation not permitted)?")
+set(RunCMake_DEFAULT_stderr "(A required privilege is not held by the client)?")
set(RunCMake_TEST_BINARY_DIR
${RunCMake_BINARY_DIR}/E_create_symlink-broken-build)
set(RunCMake_TEST_NO_CLEAN 1)
@@ -403,7 +403,7 @@ run_cmake_command(E_create_hardlink-no-directory
#On Windows, if the user does not have sufficient privileges
#don't fail this test
-set(RunCMake_DEFAULT_stderr "(operation not permitted)?")
+set(RunCMake_DEFAULT_stderr "(A required privilege is not held by the client)?")
run_cmake_command(E_create_hardlink-unresolved-symlink-prereq
${CMAKE_COMMAND} -E create_symlink ${dir}/1 ${dir}/1-symlink
)