Simplify the cmake logic to install both runtime and import libraries (treated as ARCHIVE), as the later are needed to link against llvm.
Details
- Reviewers
beanz bogner xiaobai rnk - Commits
- rZORG863d5bbe9084: [CMake] Install import libraries
rZORGe97e9a55ca37: [CMake] Install import libraries
rG863d5bbe9084: [CMake] Install import libraries
rGe97e9a55ca37: [CMake] Install import libraries
rGe96c98f37d3d: [CMake] Install import libraries
rL360230: [CMake] Install import libraries
Diff Detail
- Repository
- rL LLVM
Event Timeline
Yep. This looks like the right solution. Un-used install destinations are effectively ignored by CMake, so there is no reason to selectively choose only one.
Looks like the right thing to do to me. As beanz said, selectively choosing is unneeded work.
For reference, this fixes PR41704.
@rnk Does this look ok to you from the MSVC perspective as well?
@jschueller Do you need someone to commit this for you?
@mstorsjo Yes, if someone could commit this it would be great
For MSVC, this will also install the missing .lib files, but I wont test it.
Ok, I can commit it tonight/tomorrow.
FWIW, are you also running into the issue that unittests/Passes/TestPlugin fails to link when building in this configuration? (I did see your separate patch about Shlwapi.)
For MSVC, this will also install the missing .lib files, but I wont test it.
Yes, and installing them there also makes sense, as DLLs without import libs are pretty pointless. But I'll leave some time for @rnk to comment in any case.
llvm/trunk/cmake/modules/AddLLVM.cmake | ||
---|---|---|
688 | Hi Julien, With this change you effectively define COMPONENT only for the RUNTIME target. The LIBRARY and ARCHIVE targets are now added to the Unspecified component. CMake install documentation is not very robust about this: [ [ARCHIVE|LIBRARY|RUNTIME|...] [DESTINATION <dir>] ... [COMPONENT <component>] ... ] [...] This basically means that COMPONENT option has to be set after each of LIBRARY, ARCHIVE, RUNTIME options. CMake component based install and CPack cannot work properly after this commit. Would you please fix it? Thanks, |
I noticed that libLTO.dylib is no longer getting installed as part of toolchain even though it's still listed in LLVM_DISTRIBUTION_COMPONENTS and I bisected it to this change. I agree with @vzakhari, with this change LIBRARY and ARCHIVE are no longer being considered as components which breaks existing use cases of LLVM_DISTRIBUTION_COMPONENTS. Can we please revert this change?
Hi Julien,
With this change you effectively define COMPONENT only for the RUNTIME target. The LIBRARY and ARCHIVE targets are now added to the Unspecified component.
CMake install documentation is not very robust about this:
install(TARGETS targets... [EXPORT <export-name>]
...
...
This basically means that COMPONENT option has to be set after each of LIBRARY, ARCHIVE, RUNTIME options.
CMake component based install and CPack cannot work properly after this commit. Would you please fix it?
Thanks,
Slava