-
Notifications
You must be signed in to change notification settings - Fork 274
Simplify CMake by using LLVM Cmake config files #227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* In the "initialized" callback, send client/registerCapability with DidChangeWatchedFilesRegistrationOptions * In workspace/didChangeWatchedFiles callback, call pipeline::Index * In pipeline::Index, add a `deleted` status
This fixes a plethora of "not indexed" errors when the document has not been indexed. * Message handler throws NotIndexed * The message is put into backlog and tagged with backlog_path * path2backlog keeps backlog associated with a document and a merged index clears the backlog * backlog[0] is forced to run if it becomes overdue
Fix #180 index.initialBlacklist: ["."] can inhibit initial indexing (useful for larger code bases). Opened files are still indexed, though. This heuristic allows related files (a/foo.c a/b/foo.cc) to be indexed when a header (foo.h) is opened.
Fix #190 If a new header is added, the preamble size changes. Language clients may cache completion results, thus we rebuild preamble to avoid inaccurate results.
Change -log-file-append to a boolean flag
This completes the fix of "not indexed" errors, which was inadvertently omitted in a previous fix.
|
Thanks for your help!
Which llvm cmake files does it read?
LLVM=$(realpath ~/llvm)
cmake -H. -Bbuild -G Ninja -DCMAKE_PREFIX_PATH="$LLVM/Release;$LLVM/Release/tools/clang;$LLVM;$LLVM/tools/clang"
|
|
Did you The config files themselves should be located in |
e4927d2 to
da360d2
Compare
7d33c85 to
00158e2
Compare
d3a3bce to
2d6d718
Compare
|
@madscientist Thanks. Changed to target_include_directories(ccls PRIVATE src)
target_include_directories(ccls SYSTEM PRIVATE
third_party ${LLVM_INCLUDE_DIRS} ${CLANG_INCLUDE_DIRS})
@DaanDeMeyer I don't understand how |
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries * Restrict -DCLANG_RESOURCE_DIRECTORY= to src/utils.cc
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries * Restrict -DCLANG_RESOURCE_DIRECTORY= to src/utils.cc
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries * Restrict -DCLANG_RESOURCE_DIRECTORY= to src/utils.cc
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries * Restrict -DCLANG_RESOURCE_DIRECTORY= to src/utils.cc
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries * Restrict -DCLANG_RESOURCE_DIRECTORY= to src/utils.cc
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries * Restrict -DCLANG_RESOURCE_DIRECTORY= to src/utils.cc
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries * Restrict -DCLANG_RESOURCE_DIRECTORY= to src/utils.cc
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries * Restrict -DCLANG_RESOURCE_DIRECTORY= to src/utils.cc
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries * Restrict -DCLANG_RESOURCE_DIRECTORY= to src/utils.cc
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries * Restrict -DCLANG_RESOURCE_DIRECTORY= to src/utils.cc
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries * Restrict -DCLANG_RESOURCE_DIRECTORY= to src/utils.cc
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries * Restrict -DCLANG_RESOURCE_DIRECTORY= to src/utils.cc
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries * Restrict -DCLANG_RESOURCE_DIRECTORY= to src/utils.cc
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries * Restrict -DCLANG_RESOURCE_DIRECTORY= to src/utils.cc
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries * Restrict -DCLANG_RESOURCE_DIRECTORY= to src/utils.cc
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries * Restrict -DCLANG_RESOURCE_DIRECTORY= to src/utils.cc
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries * Restrict -DCLANG_RESOURCE_DIRECTORY= to src/utils.cc
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries * Restrict -DCLANG_RESOURCE_DIRECTORY= to src/utils.cc
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries * Restrict -DCLANG_RESOURCE_DIRECTORY= to src/utils.cc
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries * Restrict -DCLANG_RESOURCE_DIRECTORY= to src/utils.cc
Combined Daan De Meyer's #227 with other simplification * USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB * LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake * Only direct Clang/LLVM dependencies are required in target_link_libraries * Restrict -DCLANG_RESOURCE_DIRECTORY= to src/utils.cc
Simplifies the CMake build even further by using the LLVM CMake config files instead of implementing the logic ourselves.
I couldn't use the LLVM CMake config files in cquery because they aren't bundled with the LLVM Windows archive just like the LLVM libraries but since you use the LLVM libraries it's already impossible to use ccls with the Windows archive which means we might as well assume the LLVM CMake config files are available.
I verified ccls builds with these changes but I don't use it myself so you might want to check if everything still works as expected before merging this.