[PATCH] D91859: [clangd] Fix shared-lib builds

Kirill Bobyrev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 20 04:56:13 PST 2020


kbobyrev requested changes to this revision.
kbobyrev added a comment.
This revision now requires changes to proceed.

Thank you for taking care of thiis!

The complete fix, however, should include two more things:

1. Moving this

  if (CLANGD_ENABLE_REMOTE)
    include(FindGRPC)
  endif()

before that

  if(CLANG_INCLUDE_TESTS)
  add_subdirectory(test)
  add_subdirectory(unittests)
  endif()

Otherwise by the time unittests are compiled the include paths are not set appropriately and we will see the errors with Protobuf version mismatch through transitive includes etc.

2. `ClangdTests` should be linked against `RemoteIndexProto`, I didn't notice this problem before since linking `clangdRemoteMarshalling` already did the trick for static index builds but now we need to do that explicitly in `clangd/unittests/CMakeLists.txt`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91859



More information about the cfe-commits mailing list