diff --git a/clang-tools-extra/clangd/index/remote/CMakeLists.txt b/clang-tools-extra/clangd/index/remote/CMakeLists.txt --- a/clang-tools-extra/clangd/index/remote/CMakeLists.txt +++ b/clang-tools-extra/clangd/index/remote/CMakeLists.txt @@ -1,6 +1,6 @@ if (CLANGD_ENABLE_REMOTE) - generate_grpc_protos(RemoteIndexProtos "Index.proto") - include_directories(${CMAKE_CURRENT_BINARY_DIR}) + add_subdirectory(protos) + include_directories(${CMAKE_CURRENT_BINARY_DIR}/protos) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../) # FIXME(kirillbobyrev): target_compile_definitions is not working with diff --git a/clang-tools-extra/clangd/index/remote/protos/CMakeLists.txt b/clang-tools-extra/clangd/index/remote/protos/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/clang-tools-extra/clangd/index/remote/protos/CMakeLists.txt @@ -0,0 +1 @@ +generate_grpc_protos(RemoteIndexProtos "Index.proto") diff --git a/clang-tools-extra/clangd/index/remote/Index.proto b/clang-tools-extra/clangd/index/remote/protos/Index.proto rename from clang-tools-extra/clangd/index/remote/Index.proto rename to clang-tools-extra/clangd/index/remote/protos/Index.proto diff --git a/llvm/cmake/modules/FindGRPC.cmake b/llvm/cmake/modules/FindGRPC.cmake --- a/llvm/cmake/modules/FindGRPC.cmake +++ b/llvm/cmake/modules/FindGRPC.cmake @@ -45,6 +45,6 @@ "${ProtoSourceAbsolutePath}" DEPENDS "${ProtoSourceAbsolutePath}") - add_library(${LibraryName} ${GeneratedProtoSource} ${GeneratedGRPCSource}) - target_link_libraries(${LibraryName} grpc++ protobuf) + add_clang_library(${LibraryName} ${GeneratedProtoSource} ${GeneratedGRPCSource} + LINK_LIBS grpc++ protobuf) endfunction()