From 2978b10aa164f692d48041327e27b2811649a233 Mon Sep 17 00:00:00 2001 From: Kirill Bobyrev Date: Fri, 31 Jul 2020 14:02:19 +0200 Subject: [PATCH] [clangd] Fix remote index build on macOS macOS builds suddenly started failing: https://github.com/kirillbobyrev/indexing-tools/runs/925090879 This patch makes use of imported libraries and fixes builds for macOS. Landing this without a review since the patch is quite straightforward and I've been testing it on my local macOS machine for a while. Differential Revision: https://reviews.llvm.org/D84928 --- llvm/cmake/modules/FindGRPC.cmake | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/llvm/cmake/modules/FindGRPC.cmake b/llvm/cmake/modules/FindGRPC.cmake index 8a0ca59..70d67ce 100644 --- a/llvm/cmake/modules/FindGRPC.cmake +++ b/llvm/cmake/modules/FindGRPC.cmake @@ -45,11 +45,25 @@ else() # system path. if (GRPC_HOMEBREW_RETURN_CODE EQUAL "0") include_directories(${GRPC_HOMEBREW_PATH}/include) - link_directories(${GRPC_HOMEBREW_PATH}/lib) + find_library(GRPC_LIBRARY + grpc++ + PATHS ${GRPC_HOMEBREW_PATH}/lib + NO_DEFAULT_PATH + REQUIRED) + add_library(grpc++ UNKNOWN IMPORTED GLOBAL) + set_target_properties(grpc++ PROPERTIES + IMPORTED_LOCATION ${GRPC_LIBRARY}) endif() if (PROTOBUF_HOMEBREW_RETURN_CODE EQUAL "0") include_directories(${PROTOBUF_HOMEBREW_PATH}/include) - link_directories(${PROTOBUF_HOMEBREW_PATH}/lib) + find_library(PROTOBUF_LIBRARY + protobuf + PATHS ${PROTOBUF_HOMEBREW_PATH}/lib + NO_DEFAULT_PATH + REQUIRED) + add_library(protobuf UNKNOWN IMPORTED GLOBAL) + set_target_properties(protobuf PROPERTIES + IMPORTED_LOCATION ${PROTOBUF_LIBRARY}) endif() endif() endif() -- 2.7.4