• Milian Wolff's avatar
    Also find clang include path based on runtime libclang library path · bc13f955
    Milian Wolff authored
    My KDevelop was compiled against my system libclang v7.0.1, thus
    KDEV_CLANG_BUILTIN_DIR points to /usr/lib/clang/7.0.1/include. Now
    I compiled clang 8 from sources and put it in a different folder
    in my home path and adapted LD_LIBRARY_PATH to make KDevelop pick it
    up. This then fails to find the builtin include path, since it tries
    to find `/usr/lib/clang/8.0.1/include` which doesn't exit.
    
    This patch adds another fallback to fix the above scneario: We now
    lookup the path of libclang at runtime through dlfcn.h's dladdr,
    which we pass a libclang function address, here clang_getClangVersion.
    Then on success we deduce the include path by removing the library
    name and then instead appending `clang/$version/include`, which makes
    it use /home/milian/projects/compiled/other/lib/clang/8.0.1/include
    as required.
    bc13f955
Name
Last commit
Last update
app Loading commit data...
app_templates Loading commit data...
appimage Loading commit data...
cmake/modules Loading commit data...
doc Loading commit data...
file_templates Loading commit data...
kdevplatform Loading commit data...
pics Loading commit data...
plugins Loading commit data...
release-scripts Loading commit data...
shortcuts Loading commit data...
.arcconfig Loading commit data...
.clang-format Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gitlab-ci.yml Loading commit data...
.kateconfig Loading commit data...
.kateproject Loading commit data...
.krazy Loading commit data...
AUTHORS Loading commit data...
CMakeLists.txt Loading commit data...
COPYING Loading commit data...
COPYING.DOC Loading commit data...
COPYING.LIB Loading commit data...
CTestConfig.cmake Loading commit data...
CTestCustom.cmake Loading commit data...
Doxyfile Loading commit data...
ExtraDesktop.sh Loading commit data...
INSTALL Loading commit data...
KDevelopConfig.cmake.in Loading commit data...
README.md Loading commit data...
config-kdevelop.h.cmake Loading commit data...
format.config.uncrustify Loading commit data...
format_sources Loading commit data...
kdevelop.kdev4 Loading commit data...
kdevelop_bash_completion Loading commit data...
org.kde.kdevelop.appdata.xml Loading commit data...