#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

include /usr/share/dpkg/pkg-info.mk

%:
	dh $@ --builddirectory=build/

override_dh_auto_configure:
	dh_auto_configure -- \
		-DBUILD_SHARED_LIBS=OFF \
		-DALLOW_EXTERNAL_SPIRV_TOOLS=ON \
		-DCMAKE_BUILD_TYPE=Release

ifneq (,$(filter $(DEB_HOST_ARCH), hppa powerpc ppc64 s390x sparc64))
override_dh_auto_test:
endif

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

gentarball: SOURCE=glslang
gentarball: UV=$(shell echo ${DEB_VERSION}|sed 's/-.*$$//')
gentarball:
	git archive --format=tar upstream-unstable --prefix=$(SOURCE)-$(UV)/ | gzip -9 > \
		../$(SOURCE)_$(UV).orig.tar.gz
