This function is very similar to add_llvm_library(), so this patch merges it
into add_llvm_library() and replaces all calls to add_llvm_loadable_module(lib ...)
with add_llvm_library(lib MODULE ...)
Details
Diff Detail
- Repository
- rL LLVM
- Build Status
Buildable 22401 Build 22401: arc lint + arc unit
Event Timeline
cmake/modules/AddLLVM.cmake | ||
---|---|---|
677 | I don't believe there is any situation where calling add_llvm_library with MODULE would ever result in not creating the target, so this condition is probably not needed, which makes me think we should probably just get rid of add_llvm_loadable_module entirely. |
cmake/modules/AddLLVM.cmake | ||
---|---|---|
677 | Looks like it won't be created if(NOT LLVM_ENABLE_PLUGINS AND NOT (ARG_PLUGIN_TOOL AND LLVM_EXPORT_SYMBOLS_FOR_PLUGINS)) |
cmake/modules/AddLLVM.cmake | ||
---|---|---|
677 | What about when LLVM_ENABLE_PLUGINS is OFF? I tried a similar solution for D50668, and I thought this was why the Windows bots failed. The other thing add_llvm_loadable_module does is: set_target_properties(${name} PROPERTIES FOLDER "Loadable modules") Would this be OK to drop? |
cmake/modules/AddLLVM.cmake | ||
---|---|---|
677 | @philip.pffae, you're right. I think if the goal is to make add_llvm_library support MODULE I still think we should have it replace add_llvm_loadable_module. Much of what is in the later is already implemented in add_llvm_library anyways (like all the install goop). It might make sense to handle the case where the target isn't created in add_llvm_library with an early return after the llvm_add_library call that just creates the dummy target. @tstellar, It is probably best to just move the folder setting into add_llvm_library if MODULE is set. That is really just for sorting things in the IDE generators, so it probably makes sense. |
Some of the clang examples use the add_llvm_loadable_module() macro, so I will need to update those too in a separate patch.
this change broken mingw build.
CMake Error at cmake/modules/AddLLVM.cmake:667 (install): install TARGETS given no LIBRARY DESTINATION for module target "BugpointPasses". Call Stack (most recent call first): tools/bugpoint-passes/CMakeLists.txt:17 (add_llvm_library) CMake Error at cmake/modules/AddLLVM.cmake:667 (install): install TARGETS given no LIBRARY DESTINATION for module target "TestPlugin". Call Stack (most recent call first): unittests/Passes/CMakeLists.txt:18 (add_llvm_library)
Maybe add a release note for out-of-tree users of this? We had to adjust our clang plugin build files in Chromium for example.
I don't believe there is any situation where calling add_llvm_library with MODULE would ever result in not creating the target, so this condition is probably not needed, which makes me think we should probably just get rid of add_llvm_loadable_module entirely.