From 227598dbc7b884aa22efdeaa67b13d174dafe767 Mon Sep 17 00:00:00 2001 From: Sam McCall Date: Sat, 29 Jan 2022 02:28:13 +0000 Subject: [PATCH] Build clangd remote index (grpc & protobuf dependency) --- debian/control | 3 ++- debian/rules | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 48d3f218..a538a82d 100644 --- a/debian/control +++ b/debian/control @@ -23,7 +23,8 @@ Build-Depends: debhelper (>= 9.0), cmake, ninja-build, dh-exec, dh-ocaml [amd64 arm64 armhf ppc64el riscv64 s390x], libpfm4-dev [linux-any], python3-setuptools, libz3-dev, llvm-spirv [ amd64 arm64 armel armhf mips64el mipsel ppc64el s390x ] | hello [!i386], - spirv-tools [ linux-any ] | hello [ !i386] + spirv-tools [ linux-any ] | hello [ !i386], + libgrpc++-dev, libprotobuf-dev, protobuf-compiler, protobuf-compiler-grpc # "| hello" is for older buster/bionic distros without spirv support Build-Conflicts: oprofile Standards-Version: 4.2.1 diff --git a/debian/rules b/debian/rules index 120d97d5..5a325b6c 100755 --- a/debian/rules +++ b/debian/rules @@ -125,6 +125,18 @@ ZARCH=z13 endif STAGE_2_CMAKE_EXTRA += -DCLANG_SYSTEMZ_DEFAULT_ARCH=$(ZARCH) +# clangd remote index support requires GRPC & protobuf. +# Enable if minimum tested versions are available. +ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' libgrpc++-dev) gt 1.30.0; echo $$?),0) +ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' protobuf-compiler-grpc) gt 1.30.0; echo $$?),0) +ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' libprotobuf-dev) gt 3.12.0; echo $$?),0) +ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' protobuf-compiler) gt 3.12.0; echo $$?),0) +STAGE_2_CMAKE_EXTRA += -DCLANGD_ENABLE_REMOTE=ON +endif +endif +endif +endif + export CC=gcc-$(GCC_VERSION) export CXX=g++-$(GCC_VERSION)