From: Aleksandr Platonov Date: Mon, 17 Aug 2020 13:51:58 +0000 (+0300) Subject: [clangd] Fix Windows build when remote index is enabled. X-Git-Tag: llvmorg-13-init~14531 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bc5c9df62182bff1329f04ab47776b0bc70f1e1a;p=platform%2Fupstream%2Fllvm.git [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 --- 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}.