This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Fix remote index build without shared libs mode
ClosedPublic

Authored by kbobyrev on Apr 26 2020, 4:21 PM.

Details

Summary

Generated Protobuf library has to be in CLANG_EXPORTS and should also be
installed appropriately. The easiest way to do that is via CMake's
add_clang_library. That unfortunately applies "one directory - one
clang_(library|tool)" policy so .proto files should be in a separate directory
and complicates the layout.

This setup works both in shared and static libs mode.

Resolves: https://github.com/clangd/clangd/issues/351

Diff Detail

Event Timeline

kbobyrev created this revision.Apr 26 2020, 4:21 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 26 2020, 4:21 PM
kbobyrev updated this revision to Diff 260188.Apr 26 2020, 4:48 PM

Slightly adjust the CMake scripts.

kbobyrev updated this revision to Diff 260606.Apr 28 2020, 5:56 AM

Don't create a separate directory for proto files.

sammccall added inline comments.Apr 28 2020, 6:23 AM
clang-tools-extra/clangd/index/remote/CMakeLists.txt
22 ↗(On Diff #260606)

would be nice to avoid specifying this here if it's not needed

clang-tools-extra/clangd/index/remote/server/CMakeLists.txt
8

why this removal?

llvm/cmake/modules/AddLLVM.cmake
412 ↗(On Diff #260606)

why do you need to parse this and then explicitly pass it through, rather than just letting it fall into ARG_UNPARSED_ARGUMENTS?

llvm/cmake/modules/LLVMProcessSources.cmake
60

This name could be better, I think.

What about PARTIAL_SOURCES_INTENDED?

kbobyrev updated this revision to Diff 260618.Apr 28 2020, 6:34 AM
kbobyrev marked 5 inline comments as done.

Address review comments.

clang-tools-extra/clangd/index/remote/server/CMakeLists.txt
8

Discussed in the chat.

sammccall accepted this revision.Apr 28 2020, 7:09 AM
sammccall added inline comments.
clang-tools-extra/clangd/index/remote/server/CMakeLists.txt
8

For the record: redundant with parent package (this is a cleanup-while-here)

This revision is now accepted and ready to land.Apr 28 2020, 7:09 AM
Harbormaster completed remote builds in B54957: Diff 260618.
This revision was automatically updated to reflect the committed changes.