Fixes PR43430.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
+@Szelethus because i'm a bit out-of-the-loop on plugins: i very vaguely remember that we decided to put them into tests(?)
The plugins were in test, but D62445 changed that. Another solution would have been to move them into the unittests directory. But other example plugins are also part of the ordinary source tree, see for example llvm/lib/Transforms/Hello. In fact this change is based on LLVMHello, which also has BUILDTREE_ONLY.
The patch looks alright, I won't formally accept because if I knew how these worked, it wouldn't have caused so much pain to so many people :)
I honestly feel bad about these plugins. The first analyzer plugin laid in the examples/ folder, but I was cautioned against adding more there as we're not really supporting them, but I think all the trouble of moving them wasn't worth it at all for such a negligible "gain".
If it helps, this is from add_llvm_library in llvm/cmake/modules/AddLLVM.cmake:
if (ARG_MODULE AND NOT TARGET ${name}) # Add empty "phony" target add_custom_target(${name}) elseif( EXCLUDE_FROM_ALL ) set_target_properties( ${name} PROPERTIES EXCLUDE_FROM_ALL ON) elseif(ARG_BUILDTREE_ONLY) set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name}) else() # ... installation code ... set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) endif()
The plugins are modules, but the targets exist, so we don't run into the first branch. With EXCLUDE_FROM_ALL we would make the target not being build by default, and with ARG_BUILDTREE_ONLY we make them build, but not install.
I honestly feel bad about these plugins. The first analyzer plugin laid in the examples/ folder, but I was cautioned against adding more there as we're not really supporting them, but I think all the trouble of moving them wasn't worth it at all for such a negligible "gain".
Moving them out of test was probably necessary, but the current location should be fine.
I feel like i can stamp this.
There's similar-isn problem with lit-cpuid which is referenced in LLVMExports.cmake but is packaged in debian in lldb...