#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

ifneq ($(filter pkg.kgx.generic,$(DEB_BUILD_PROFILES)),)
	MESON_OPTS += -Dgeneric=true
else
	MESON_OPTS += -Dgeneric=false
endif

ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
	MESON_OPTS += -Dtests=true -Dgir=true
else
	MESON_OPTS += -Dtests=false -Dgir=false
endif

%:
	dh $@ --builddirectory=_build

override_dh_auto_configure:
	dh_auto_configure -- $(MESON_OPTS)

override_dh_auto_test:
ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
	LC_ALL=C.UTF-8 xvfb-run ninja -C _build test
endif
