On Windows we don't create symlinks for the binaries (clang++, clang-cl)
since the support requires special setup (group policy settings and
you need to know exactly our distribution story). But if you know
about these things and have a controlled environment there is a lot
of storage to be saved, so let's add a manual opt-in for using symlinks
on Windows with LLVM_FORCE_CREATE_SYMLINKS=ON.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I'd prefer to have an option like LLVM_USE_SYMLINKS and default to ON when CMAKE_HOST_UNIX, otherwise OFF.
This looks reasonable to me (although I haven't dug through the code to see if there are more cases that would need to be set in sync). Is it kosher to add new end-user options like this in a nested cmake module file?
I'll leave it open for @phosek to comment on in any case.
There are other places where symlinks are used and some similar logic is being applied - like here:
https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/builtins/CMakeLists.txt#L533
I am not sure it's worth to fix this at the same time since that has to do with symlinking the files when building rather then the finished distribution.
Regarding option() in this cmakefile - I had the same idea, but I saw several option() calls in this file already, so I figured it was a pattern already.
This would be a separate option since we don't use AddLLVM.cmake module in that context so I think it's better to do it as a separate change.
Regarding option() in this cmakefile - I had the same idea, but I saw several option() calls in this file already, so I figured it was a pattern already.
Those are only defined in functions, there are no top-level options in this module. I'd move this option to llvm/CMakeLists.txt.