When LLVM_INSTALL_TOOLCHAIN_ONLY is used and LLVM_TOOLCHAIN_TOOLS contains a tool which is a symlink, it would be ignored. This already worked before but got broken in r282510.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Looking at this, I messed up that logic worse than this fixes. I completely broke LLVM_INSTALL_TOOLCHAIN_ONLY=Off for symlinks.
I think something like this would cover your case and fix LLVM_INSTALL_TOOLCHAIN_ONLY:
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake index 51ae62d..00f2e80 100644 --- a/cmake/modules/AddLLVM.cmake +++ b/cmake/modules/AddLLVM.cmake @@ -1264,11 +1264,11 @@ function(add_llvm_tool_symlink name dest) set_target_properties(${target_name} PROPERTIES FOLDER Tools) # Make sure both the link and target are toolchain tools - if (NOT ${name} IN_LIST LLVM_TOOLCHAIN_TOOLS OR NOT ${dest} IN_LIST LLVM_TOOLCHAIN_TOOLS) - return() + if (${name} IN_LIST LLVM_TOOLCHAIN_TOOLS OR ${dest} IN_LIST LLVM_TOOLCHAIN_TOOLS) + set(TOOL_IS_TOOLCHAIN On) endif() - if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_TOOLS ) + if ((TOOL_IS_TOOLCHAIN OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) AND LLVM_BUILD_TOOLS) llvm_install_symlink(${name} ${dest}) endif() endif()
Thoughts?
Comment Actions
LGTM! Shouldn't TOOL_IS_TOOLCHAIN be lowercase since a lower-case variable (I've seen both variants used in LLVM so I'm not sure if there is convention)? Shall I just update the diff with your version or do you want submit a new diff?
Comment Actions
One comment below. Otherwise LGTM, go ahead and commit.
Thanks for catching this!
cmake/modules/AddLLVM.cmake | ||
---|---|---|
1268 | This should actually be AND not OR since we shouldn't install the symlink without also installing the tool. |
This should actually be AND not OR since we shouldn't install the symlink without also installing the tool.