Open banach-space opened 3 years ago
Looking at the definition of add_clang_executable
, it feels that add_llvm_executable
should be sufficient for us.
Similarly, clang_target_link_libraries
could be replaced with target_link_libraries
. So, include(AddLLVM)
could be replaced with include(AddClang)
, which means that this is doable :)
The tools from clang-tutor fail to build when using Clang/LLVM that was build with
BUILD_SHARED_LIBS
set. This is the error that I see on Ubuntu 16.04:SOLUTION 1 A solution was submitted by @xgupta here. It went through a few iterations. The original approach looked like this:
However, we discovered that that didn't work well with pre-build binary packages from Ubuntu 16.04. This is the error that I was getting at run-time:
So this was regression. It's hard to fix as it's not clear how the packages from Ubuntu are built and how to reproduce this with manually built packages.
SOLUTION 2 @xgupta kindly submitted an updated solution that is based on Clang's reference example. However, for this to work clang-tutor needs access to:
add_clang_executable
clang_target_link_libraries
This would normally be achieved with
include(AddClang)
in one of the CMake scripts. However, currentlyAddClang
is not copied/installed in the build directory. A fix has been proposed here. One can also work around this by pointing clang-tutor to Clang's source directory (i.e. the location ofAddClang
). But that would mean that Ubuntu's pre-build packages alone are no longer sufficient to build the project.SUMMARY Both approaches break clang-tutor when using Ubuntu's pre-build LLVM/Clang packages. I think that SOLUTION 2 would be more canonical, but we may need for D94533 to be merged.