From 2ef2841c0d0b49a76ea9026f37207a473d7d1332 Mon Sep 17 00:00:00 2001 From: Sam McCall Date: Tue, 27 Oct 2020 09:15:12 +0100 Subject: [PATCH] [clangd] Fix proto deps, for real this time. This is ugly (layering violation) but we can clean it up once we know it works in CI. --- clang-tools-extra/clangd/index/remote/CMakeLists.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/clang-tools-extra/clangd/index/remote/CMakeLists.txt b/clang-tools-extra/clangd/index/remote/CMakeLists.txt index 971af20..554288d 100644 --- a/clang-tools-extra/clangd/index/remote/CMakeLists.txt +++ b/clang-tools-extra/clangd/index/remote/CMakeLists.txt @@ -1,12 +1,13 @@ if (CLANGD_ENABLE_REMOTE) generate_protos(RemoteIndexServiceProto "Service.proto" GRPC) generate_protos(RemoteIndexProto "Index.proto") - target_link_libraries(RemoteIndexServiceProto - - PUBLIC - RemoteIndexProto - ) - add_dependencies(RemoteIndexServiceProto RemoteIndexProto) + # Ensure dependency headers are generated before dependent protos are built. + # FIXME: this should be encapsulated in generate_protos. + # FIXME: CMake docs say OBJECT_DEPENDS isn't needed, but I can't get the + # recommended add_dependencies() approach to work. + set_source_files_properties( + ${CMAKE_CURRENT_BINARY_DIR}/Service.pb.cc + PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Index.pb.h) include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../) -- 2.7.4