Build clangd remote index (grpc & protobuf dependency)

This commit is contained in:
Sam McCall 2022-01-29 02:28:13 +00:00 committed by Sylvestre Ledru
parent f1e99fac32
commit 227598dbc7
2 changed files with 14 additions and 1 deletions

3
debian/control vendored
View File

@ -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 ] <!stage1> | 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

12
debian/rules vendored
View File

@ -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)