https://reviews.llvm.org/D61446 introduced a new function to process pass plugins that used CMAKE_BINARY_DIR. This is problematic when LLVM is a subproject. Instead use CMAKE_CURRENT_BINARY_DIR to get the right relative directory for cmake.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I don't think CMAKE_CURRENT_BINARY_DIR will work. It is different for each subdirectory, such that multiple plugins create separate Extension.def.tmp instead of appending to a central one. LLVM_BINARY_DIR might be the better choice.
llvm/cmake/modules/AddLLVM.cmake | ||
---|---|---|
907 | That they didn't match was a left over mistake from testing. In my setups they evaluated to the same values. I'll switch all uses to LLVM_BINARY_DIR as Meinersbur suggested. |
I do not have commit access. Would it be possible for someone to commit it on my behalf? Thanks.
I changed CMAKE_CURRENT_BINARY_DIR to LLVM_BINARY_DIR in the commit description. Thank you for the patch.
This broke standalone build of clang. It's trying to write into /include (as in, root directory) now! My guess is that LLVM_BINARY_DIR is undefined at this point of standalone build, later it might be defined to point to directory where LLVM was installed which also wouldn't be correct.
* ACCESS DENIED: mkdir: /include CMake Error at /usr/lib/llvm/11/lib64/cmake/llvm/AddLLVM.cmake:894 (file): file failed to open for writing (No such file or directory): /include/llvm/Support/Extension.def.tmp Call Stack (most recent call first): CMakeLists.txt:867 (process_llvm_pass_plugins)
Why CMAKE_CURRENT_BINARY_DIR and not LLVM_BINARY_DIR as in line 903?