Feature request: support real symlinks under Windows in Developer Mode
If Developer Mode is enabled in Windows 10 or Windows Server 2019, normal users can create symlinks. When cross compiling for Linux from Windows, CMake currently does not support creating proper library symlinks, but always copies the files. It would be nice to have the option to create symlinks instead of copies in Developer Mode.
Example for clarification:
I have a shared library target for Linux called xyz
, and I set the property VERSION
to 1.2.3
and SOVERSION
to 1
.
- When compiling natively under Linux, this will create the a file named
libxyz.so.1.2.3
, and two symlinks namedlibxyz.so.1
andlibxyz.so
. - When cross compiling the same library on Windows (using clang.exe), this will create three regular files named
libxyz.so.1.2.3
,libxyz.so.1
, andlibxyz.so
.
It would be nice to have the option to create real symlinks under Windows as well, which would be no problem in Developer Mode. I was thinking of something like a CMake variable called CMAKE_CREATE_WINDOWS_SYMLINKS
, or maybe a target property. Or, the security policy could be checked, and symlinks created if the user has the appropriate rights.