#!/usr/bin/make -f
# -*- makefile -*-

include /usr/share/dpkg/architecture.mk

export DEB_BUILD_MAINT_OPTIONS=hardening=+all
# Smoke tests require the package to be installed to run, which is not possible at build time
export SMOKE_TESTS = kcm_cellular_network_smoketest|kcm_mobile_hotspot_smoketest|kcm_mobile_wifi_smoketest|kcm_mobile_wired_smoketest
export EXCLUDED_TESTS = ${SMOKE_TESTS}


# limit the build of OpenConnect VPN to archs where qtwebengine is available
ifneq (,$(filter $(DEB_HOST_ARCH), amd64 arm64 armhf i386))
	extra_cmake_args += -DBUILD_OPENCONNECT=ON
else
	extra_cmake_args += -DBUILD_OPENCONNECT=OFF
endif

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- $(extra_cmake_args)

override_dh_auto_test:
	xvfb-run -a -- dh_auto_test -Skf6 -- ARGS+="-E \"^(${EXCLUDED_TESTS})\""
