PR #425 adds llvm headers by -idirafter to make them lowest priority in path search, however this introduces a new problem
ubuntu 20.04
llvm-dev installed by apt, this is llvm version 10, headers are on /usr/include, the default header location
using LLVM_DIR to build hobbes with different llvm version, like LLVM_DIR=/home/ubuntu/llvm-12.0.1/install/lib/cmake/llvm cmake -Bbuild -S. ....
in this case, the search order is
#include <...> search starts here:
/usr/lib/gcc/x86_64-linux-gnu/9/include
/usr/local/include
/usr/include/x86_64-linux-gnu
/usr/include <<-- llvm-dev version 10, wrong headers
/home/ubuntu/llvm-12.0.1/install/include <<-- here is the correct path
End of search list.
compiler will use llvm10's header file, and link against llvm12's lib, which causes undefined reference linking error
It occurs to me that with multiple (versions?) of toolchains mixed together, there is no (easy?) way to cover all permutations
I'm thinking of making CMakeLists.txt as simple as possible, and just covers most common cases might not be the worst idea
…onflicts (#425)"
PR #425 adds llvm headers by
-idirafter
to make them lowest priority in path search, however this introduces a new problem/usr/include
, the default header locationLLVM_DIR
to build hobbes with different llvm version, likeLLVM_DIR=/home/ubuntu/llvm-12.0.1/install/lib/cmake/llvm cmake -Bbuild -S. ....
in this case, the search order is
compiler will use llvm10's header file, and link against llvm12's lib, which causes undefined reference linking error
It occurs to me that with multiple (versions?) of toolchains mixed together, there is no (easy?) way to cover all permutations
I'm thinking of making
CMakeLists.txt
as simple as possible, and just covers most common cases might not be the worst idea