Mercurial > hg > CbC > CbC_llvm
diff clang-tools-extra/clangd/CMakeLists.txt @ 221:79ff65ed7e25
LLVM12 Original
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 15 Jun 2021 19:15:29 +0900 |
parents | 0572611fdcc8 |
children | 5f17cb93ff66 |
line wrap: on
line diff
--- a/clang-tools-extra/clangd/CMakeLists.txt Tue Jun 15 19:13:43 2021 +0900 +++ b/clang-tools-extra/clangd/CMakeLists.txt Tue Jun 15 19:15:29 2021 +0900 @@ -14,7 +14,15 @@ unset(CLANGD_BUILD_XPC_DEFAULT) endif () -llvm_canonicalize_cmake_booleans(CLANGD_BUILD_XPC) +option(CLANGD_MALLOC_TRIM "Call malloc_trim(3) periodically in Clangd. (only takes effect when using glibc)" ON) + +llvm_canonicalize_cmake_booleans( + CLANGD_BUILD_XPC + CLANGD_ENABLE_REMOTE + ENABLE_GRPC_REFLECTION + CLANGD_MALLOC_TRIM + LLVM_ENABLE_ZLIB +) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Features.inc.in @@ -25,10 +33,21 @@ Support AllTargetsInfos FrontendOpenMP + Option ) +include(${CMAKE_CURRENT_SOURCE_DIR}/quality/CompletionModel.cmake) +gen_decision_forest(${CMAKE_CURRENT_SOURCE_DIR}/quality/model CompletionModel clang::clangd::Example) + +if(MSVC AND NOT CLANG_CL) + set_source_files_properties(CompileCommands.cpp PROPERTIES COMPILE_FLAGS -wd4130) # disables C4130: logical operation on address of string constant +endif() + +include_directories(BEFORE "${CMAKE_CURRENT_BINARY_DIR}/../clang-tidy") + add_clang_library(clangDaemon AST.cpp + ASTSignals.cpp ClangdLSPServer.cpp ClangdServer.cpp CodeComplete.cpp @@ -36,9 +55,15 @@ CollectMacros.cpp CompileCommands.cpp Compiler.cpp + Config.cpp + ConfigCompile.cpp + ConfigProvider.cpp + ConfigYAML.cpp Diagnostics.cpp DraftStore.cpp + DumpAST.cpp ExpectedTypes.cpp + FeatureModule.cpp FindSymbols.cpp FindTarget.cpp FileDistance.cpp @@ -48,8 +73,10 @@ GlobalCompilationDatabase.cpp Headers.cpp HeaderSourceSwitch.cpp + HeuristicResolver.cpp Hover.cpp IncludeFixer.cpp + InlayHints.cpp JSONTransport.cpp PathMapping.cpp Protocol.cpp @@ -62,9 +89,11 @@ SemanticSelection.cpp SourceCode.cpp QueryDriverDatabase.cpp + TidyProvider.cpp TUScheduler.cpp URI.cpp XRefs.cpp + ${CMAKE_CURRENT_BINARY_DIR}/CompletionModel.cpp index/Background.cpp index/BackgroundIndexLoader.cpp @@ -77,6 +106,7 @@ index/IndexAction.cpp index/MemIndex.cpp index/Merge.cpp + index/ProjectAware.cpp index/Ref.cpp index/Relation.cpp index/Serialization.cpp @@ -95,7 +125,17 @@ refactor/Rename.cpp refactor/Tweak.cpp - LINK_LIBS + DEPENDS + omp_gen + ) + +# Include generated CompletionModel headers. +target_include_directories(clangDaemon PUBLIC + $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}> +) + +clang_target_link_libraries(clangDaemon + PRIVATE clangAST clangASTMatchers clangBasic @@ -106,15 +146,20 @@ clangLex clangSema clangSerialization - clangTidy clangTooling clangToolingCore clangToolingInclusions - clangToolingRefactoring clangToolingSyntax + ) + +target_link_libraries(clangDaemon + PRIVATE + ${LLVM_PTHREAD_LIB} + + clangTidy + ${ALL_CLANG_TIDY_CHECKS} + clangdSupport - ${LLVM_PTHREAD_LIB} - ${ALL_CLANG_TIDY_CHECKS} ) add_subdirectory(refactor/tweaks) @@ -132,17 +177,18 @@ add_subdirectory(xpc) endif () +if (CLANGD_ENABLE_REMOTE) + include(FindGRPC) +endif() + if(CLANG_INCLUDE_TESTS) -add_subdirectory(test) -add_subdirectory(unittests) + add_subdirectory(test) + add_subdirectory(unittests) endif() # FIXME(kirillbobyrev): Document this in the LLVM docs once remote index is stable. option(CLANGD_ENABLE_REMOTE "Use gRPC library to enable remote index support for Clangd" OFF) set(GRPC_INSTALL_PATH "" CACHE PATH "Path to gRPC library manual installation.") -if (CLANGD_ENABLE_REMOTE) - include(FindGRPC) -endif() add_subdirectory(index/remote) add_subdirectory(index/dex/dexp)