[PATCH] D145302: [clangd] Add library for clangd main function

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 22 08:02:47 PDT 2023


kadircet added a comment.

thanks LG and seems to be working in a couple build configurations I tried. but there might still be breakages in different configs, so please be on the watchout after landing this for breakages in https://lab.llvm.org/.

FWIW something like:

  # Needed by LLVM's CMake checks because this file defines multiple targets.
  set(LLVM_OPTIONAL_SOURCES ClangdToolMain.cpp)
  
  add_clang_library(clangdMain
    Check.cpp
    ClangdMain.cpp
    )
  
  clang_target_link_libraries(clangdMain
    PRIVATE
    clangAST
    clangBasic
    clangDaemon
    clangFormat
    clangFrontend
    clangLex
    clangSema
    clangTidy
    clangTooling
    clangToolingCore
    clangToolingRefactoring
    clangToolingSyntax
    clangdRemoteIndex
    clangdSupport
    $<TARGET_OBJECTS:obj.clangDaemonTweaks>
  )
  
  if(CLANGD_BUILD_XPC)
    target_link_libraries(clangdMain
      PRIVATE
      clangdXpcJsonConversions
      clangdXpcTransport
      )
  endif()
  
  add_clang_tool(clangd
    ClangdToolMain.cpp
    )
  
  clang_target_link_libraries(clangd
    PRIVATE
    clangdMain
    )

for the CMakeFile seem to cut it.



================
Comment at: clang-tools-extra/clangd/tool/CMakeLists.txt:11
+  ClangdToolMain.cpp
   $<TARGET_OBJECTS:obj.clangDaemonTweaks>
   )
----------------
we should move this into `clangdMain` target now


================
Comment at: clang-tools-extra/clangd/tool/CMakeLists.txt:37
+
+target_link_libraries(clangdMain
+  PRIVATE
----------------
you can merge this with the previous rule


================
Comment at: clang-tools-extra/clangd/tool/CMakeLists.txt:48
   PRIVATE
+  clangdMain
   clangAST
----------------
it should be enough to have `clangdMain` here now.


================
Comment at: clang-tools-extra/clangd/tool/CMakeLists.txt:61
 
 target_link_libraries(clangd
   PRIVATE
----------------
you can get rid of this rule too


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145302/new/

https://reviews.llvm.org/D145302



More information about the cfe-commits mailing list