#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		$(if $(APP_VERSION_OVERRIDE),-DAPP_VERSION_OVERRIDE=$(APP_VERSION_OVERRIDE))

ifneq (,$(filter $(DEB_HOST_ARCH), amd64 arm64))
override_dh_auto_test:
	xvfb-run -a ctest --test-dir obj-* --output-on-failure
else
override_dh_auto_test:
	xvfb-run -a ctest --test-dir obj-* --output-on-failure -E DockerToolTests
endif

# No dbgsym packages:
override_dh_strip:
	@echo "NO--THANKS ANYWAY--but not building dbgsym packages for MX Linux"
	dh_strip --no-automatic-dbgsym
