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

Kirill Bobyrev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 20 17:02:53 PST 2020


kbobyrev added a comment.

In D91859#2408064 <https://reviews.llvm.org/D91859#2408064>, @sammccall wrote:

> I'm not totally following the discussion on the more complete fix (LMK if you want me to dig into that), but if the build is broken in some configurations we should likely prioritize fixing that over ensuring the fix is conceptually complete.

Yes, this is basically an expanded context from a discussion me and Kadir had over the last couple of days. Sorry for confusion, the "complete" means "it's still not working for me without these changes". And the configuration we're looking at is simply shared libs build.

>> 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.
>
> I don't think that's how CMake works, the whole CMakeLists tree is parsed before anything is compiled, so it shouldn't race like that.

This may look counter-intuitive but this is how it works on my machine. `MarshallingTests.cpp` entry in `compile_commands.json` does not have gRPC include path. (`rg "MarshallingTests.cpp" compile_commands.json | rg grpc` is empty). When I put `FindGRPC` before `add_directory(unittests)` the compile commands have the right include.


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