Details
-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
6.0.0
-
a7a241f830cc97c54c516e9f96ecbb3e9cc4b598 (qt/qttools/dev)
Description
At the moment FindWrapLibClang.cmake is using the same method of finding LLVM/Clang components like the corresponding QMake code.
We should use the CMake config files that LLVM/Clang provides.
On Linux distors are building with BUILD_SHARED_LIBS which causes problems with the CMake config files, because the dependent libraries are not part of the the dependencies list.
So you are linking to libclang but, you should also manually specify the shared libraries.
The LLVM documentation has this warning, which the Linux packagers just ignore:
BUILD_SHARED_LIBS is only recommended for use by LLVM developers. If you want to build LLVM as a shared library, you should use the LLVM_BUILD_LLVM_DYLIB option.
To overcome this we can use file(GET_RUNTIME_DEPENDENCIES) from CMake 3.16 to find out the dependent libraries and add them to the Wrap ones.