From bc5c9df62182bff1329f04ab47776b0bc70f1e1a Mon Sep 17 00:00:00 2001 From: Aleksandr Platonov Date: Mon, 17 Aug 2020 16:51:58 +0300 Subject: [PATCH] [clangd] Fix Windows build when remote index is enabled. CMake log: ``` CMake Error at D:/llvm-project/llvm/cmake/modules/AddLLVM.cmake:823 (add_executable): Target "clangd" links to target "Threads::Threads" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? Call Stack (most recent call first): D:/llvm-project/clang/cmake/modules/AddClang.cmake:150 (add_llvm_executable) D:/llvm-project/clang/cmake/modules/AddClang.cmake:160 (add_clang_executable) D:/llvm-project/clang-tools-extra/clangd/tool/CMakeLists.txt:4 (add_clang_tool) CMake Error at D:/llvm-project/llvm/cmake/modules/AddLLVM.cmake:821 (add_executable): Target "ClangdTests" links to target "Threads::Threads" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? Call Stack (most recent call first): D:/llvm-project/llvm/cmake/modules/AddLLVM.cmake:1417 (add_llvm_executable) D:/llvm-project/clang-tools-extra/clangd/unittests/CMakeLists.txt:32 (add_unittest) CMake Error at D:/llvm-project/llvm/cmake/modules/AddLLVM.cmake:527 (add_library): Target "RemoteIndexProtos" links to target "Threads::Threads" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? Call Stack (most recent call first): D:/llvm-project/clang/cmake/modules/AddClang.cmake:103 (llvm_add_library) D:/llvm-project/llvm/cmake/modules/FindGRPC.cmake:105 (add_clang_library) D:/llvm-project/clang-tools-extra/clangd/index/remote/CMakeLists.txt:2 (generate_grpc_protos) CMake Error at D:/llvm-project/llvm/cmake/modules/AddLLVM.cmake:527 (add_library): Target "clangdRemoteIndex" links to target "Threads::Threads" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? Call Stack (most recent call first): D:/llvm-project/clang/cmake/modules/AddClang.cmake:103 (llvm_add_library) D:/llvm-project/clang-tools-extra/clangd/index/remote/CMakeLists.txt:11 (add_clang_library) CMake Error at D:/llvm-project/llvm/cmake/modules/AddLLVM.cmake:527 (add_library): Target "clangdRemoteMarshalling" links to target "Threads::Threads" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? Call Stack (most recent call first): D:/llvm-project/clang/cmake/modules/AddClang.cmake:103 (llvm_add_library) D:/llvm-project/clang-tools-extra/clangd/index/remote/marshalling/CMakeLists.txt:1 (add_clang_library) CMake Error at D:/llvm-project/llvm/cmake/modules/AddLLVM.cmake:823 (add_executable): Target "clangd-index-server" links to target "Threads::Threads" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? ``` Reviewed By: kbobyrev Differential Revision: https://reviews.llvm.org/D86052 --- llvm/cmake/modules/FindGRPC.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/llvm/cmake/modules/FindGRPC.cmake b/llvm/cmake/modules/FindGRPC.cmake index b7fafb2..3e33c2e 100644 --- a/llvm/cmake/modules/FindGRPC.cmake +++ b/llvm/cmake/modules/FindGRPC.cmake @@ -1,5 +1,6 @@ # FIXME(kirillbobyrev): Check if gRPC and Protobuf headers can be included at # configure time. +find_package(Threads REQUIRED) if (GRPC_INSTALL_PATH) # This setup requires gRPC to be built from sources using CMake and installed # to ${GRPC_INSTALL_PATH} via -DCMAKE_INSTALL_PREFIX=${GRPC_INSTALL_PATH}. -- 2.7.4