diff options
author | Jon Chronopoulos <patches@crondog.com> | 2018-06-11 07:28:09 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-09-18 15:24:08 (GMT) |
commit | afb7f6e4ff8a0c1a68c8d8cf2d6cf72401cfb8ff (patch) | |
tree | f79c1b7cf4d0e408d3e0b98b06503b2e1cc7e5f8 /Source/cmcmd.cxx | |
parent | 49cb2a504d1e00e51774a23bf1b91c982fa69e5d (diff) | |
download | CMake-afb7f6e4ff8a0c1a68c8d8cf2d6cf72401cfb8ff.zip CMake-afb7f6e4ff8a0c1a68c8d8cf2d6cf72401cfb8ff.tar.gz CMake-afb7f6e4ff8a0c1a68c8d8cf2d6cf72401cfb8ff.tar.bz2 |
cmake: Add '-E create_symlink' support on Windows
The allows `-E create_symlink` to work on Windows. It utilizes
`uv_fs_symlink`. I am still unsure exactly which Windows platforms will
work without requiring Administrator privileges or needing a user/group
with the "Create Symbolic Links" User Rights. It does work with my
Windows 10 Pro with Developer Mode turned on. In the test suite check
that the symlink either worked or failed with a permissions error.
Use recent changes in cmSystemTools::FileExists to check that a symlink
is broken.
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r-- | Source/cmcmd.cxx | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 87da108..1d2f741 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -108,6 +108,7 @@ void CMakeCommandUsage(const char* program) << " time command [args...] - run command and display elapsed time\n" << " touch file - touch a file.\n" << " touch_nocreate file - touch a file but do not create it.\n" + << " create_symlink old new - create a symbolic link new -> old\n" #if defined(_WIN32) && !defined(__CYGWIN__) << "Available on Windows only:\n" << " delete_regv key - delete registry value\n" @@ -116,9 +117,6 @@ void CMakeCommandUsage(const char* program) << " env_vs9_wince sdkname - displays a batch file which sets the " "environment for the provided Windows CE SDK installed in VS2008\n" << " write_regv key value - write registry value\n" -#else - << "Available on UNIX only:\n" - << " create_symlink old new - create a symbolic link new -> old\n" #endif ; /* clang-format on */ @@ -868,9 +866,6 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) return 1; } if (!cmSystemTools::CreateSymlink(args[2], args[3])) { - std::string emsg = cmSystemTools::GetLastSystemError(); - std::cerr << "failed to create symbolic link '" << destinationFileName - << "': " << emsg << "\n"; return 1; } return 0; |