#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk

export QT_SELECT=5
# cf. https://github.com/MaartenBaert/ssr/issues/498
export DEB_CXXFLAGS_MAINT_APPEND := -fPIC

%:
	dh $@

# 1. simplescreenrecorder is configured to use libav libraries
#    here as libav is currently still default on Debian
#
# 2. glinjectlib is disabled on non-x86 systems as it
#    requires the x86-only elfhacks code (see README.source)

override_dh_auto_configure:
ifneq ($(filter $(DEB_HOST_ARCH_CPU), amd64 i386),)
	dh_auto_configure -- \
		--disable-assert \
		--libdir=/usr/lib/simplescreenrecorder \
		--with-qt5
else
	dh_auto_configure -- \
		--disable-x86-asm \
		--disable-assert \
		--disable-glinjectlib \
		--with-qt5
endif

override_dh_auto_install:
	dh_auto_install
	rm -f $(CURDIR)/debian/simplescreenrecorder/usr/lib/*/*.la
