mirror of
https://github.com/MaskRay/ccls.git
synced 2025-06-07 16:54:54 +00:00
Fix builds for LLVM 9 (for LLVM build without BUILD_SHARED_LIBS=ON)
LLVM 9 officially ships the C++ libraries as a single library libclang-cpp.so. This makes ccls fail to link as the individual libraries libclangIndex, libclangFormat, etc. are no longer present. We use clang-cpp if it is available and fallback to the previously used behavior if clang-cpp is not available.
This commit is contained in:
parent
bfac2162eb
commit
7381df3bdd
@ -68,8 +68,17 @@ endif()
|
|||||||
|
|
||||||
### Libraries
|
### Libraries
|
||||||
|
|
||||||
|
# LLVM >= 9 ships the C++ libraries by default in a single library libclang-cpp,
|
||||||
|
# but this is not universally enabled on all distributions.
|
||||||
|
# If clang-cpp is available, then link against it, otherwise link against the
|
||||||
|
# individual clang libraries.
|
||||||
find_package(Clang REQUIRED)
|
find_package(Clang REQUIRED)
|
||||||
|
|
||||||
|
if(TARGET clang-cpp AND NOT TARGET clangBasic)
|
||||||
|
target_link_libraries(ccls PRIVATE
|
||||||
|
clang-cpp
|
||||||
|
)
|
||||||
|
else()
|
||||||
target_link_libraries(ccls PRIVATE
|
target_link_libraries(ccls PRIVATE
|
||||||
clangIndex
|
clangIndex
|
||||||
clangFormat
|
clangFormat
|
||||||
@ -85,6 +94,7 @@ target_link_libraries(ccls PRIVATE
|
|||||||
clangDriver
|
clangDriver
|
||||||
clangBasic
|
clangBasic
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(LLVM_LINK_LLVM_DYLIB)
|
if(LLVM_LINK_LLVM_DYLIB)
|
||||||
target_link_libraries(ccls PRIVATE LLVM)
|
target_link_libraries(ccls PRIVATE LLVM)
|
||||||
|
Loading…
Reference in New Issue
Block a user