#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# Allow building against extracted .deb headers/libs when system -dev
# packages are not installed (see ../deps or ./.deps).
DEPS_ROOT ?= $(CURDIR)/.deps/root/usr
ifneq (,$(wildcard $(DEPS_ROOT)/lib/*/pkgconfig/libsearpc.pc))
export PKG_CONFIG_PATH := $(DEPS_ROOT)/lib/x86_64-linux-gnu/pkgconfig:$(PKG_CONFIG_PATH)
CMAKE_EXTRA := -DDFM_EXTENSION_ROOT=$(DEPS_ROOT)
endif

%:
	dh $@ --buildsystem=cmake

override_dh_auto_configure:
	dh_auto_configure -- \
		-DCMAKE_BUILD_TYPE=Release \
		-DBUILD_RPC_SMOKE_TEST=OFF \
		$(CMAKE_EXTRA)
