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.
This commit is contained in:
Jon Chronopoulos
2018-06-11 17:28:09 +10:00
committed by Brad King
parent 49cb2a504d
commit afb7f6e4ff
8 changed files with 76 additions and 44 deletions

View File

@@ -513,6 +513,11 @@ public:
/** Perform one-time initialization of libuv. */
static void InitializeLibUV();
/** Create a symbolic link if the platform supports it. Returns whether
creation succeeded. */
static bool CreateSymlink(const std::string& origName,
const std::string& newName);
private:
static bool s_ForceUnixPaths;
static bool s_RunCommandHideConsole;