Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows build fails trying to create symlinks #204

Open
pezcode opened this issue Dec 18, 2018 · 0 comments
Open

Windows build fails trying to create symlinks #204

pezcode opened this issue Dec 18, 2018 · 0 comments

Comments

@pezcode
Copy link

pezcode commented Dec 18, 2018

There are a few custom targets that create symlinks, like this one:

if (WIN32)
    add_custom_target(ResourcesDir ALL
        COMMAND IF NOT EXIST ${RESOURCES_DST} mklink /J ${RESOURCES_DST} ${RESOURCES_SRC}
    )
else ()
    add_custom_target(ResourcesDir ALL
        COMMAND ${CMAKE_COMMAND} -E create_symlink ${RESOURCES_SRC} ${RESOURCES_DST}
    )
endif ()

This fails trying to compile on Win10 1803 with VS 2017:

6>You do not have sufficient privilege to perform this operation.
5>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(209,5): error MSB6006: "cmd.exe" exited with code 1.

The reason behind it failing is a bit odd but the solution is pretty straightforward: Replace all mklink /D with mklink /J.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant