• Kevin Funk's avatar
    clang: Force linking against full lib path · 46126881
    Kevin Funk authored
    Force link against full library path:
    ... instead of:
    target_link_libraries has some heuristics where it prefers dropping the
    full library path in case the library is detected within alternative
    library search paths, cf.
    This is a problem in case e.g. libclang is detected in one of the
    default linker search paths of the compiler in use (in my case compiler
    was Clang 6.0 from Ubuntu repositories trying to link against libclang.so from Clang 5.0)
    and CMake attempts to link using -lclang instead of the full library path,
    thus running into issues like:
      /usr/bin/ld: error: cannot find -lclang
      .../kdevelop/plugins/clang/tests/minimal_visitor.cpp:27: error: undefined reference to 'clang_getCursorExtent'
FindClang.cmake 4.3 KB