#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) \
		-DUSE_LINKED_FFMPEG=ON \
		-DPACKAGE_MODE=ON \
		-DDISABLE_ADVANCE_SIMD=ON \
		-DENABLE_TESTS=1

override_dh_auto_build:
	# False positive from blhc. See #1125781.
	@echo 'blhc: ignore-line-regexp: /usr/(bin|lib)/(ccache/)?c\+\+ (?:-std=\S+ )?-w -dM -E (?:-c )?/usr/share/cmake-[0-9.]+/Modules/CMakeCXXCompilerABI.cpp .*'
	dh_auto_build

execute_after_dh_auto_install:
	mv debian/pcsx2/usr/bin debian/pcsx2/usr/games
	install -m644 pcsx2-qt/resources/icons/AppIcon64.png debian/pcsx2/usr/share/pixmaps/pcsx2-qt.png
	install -m644 debian/pcsx2-qt.desktop debian/pcsx2/usr/share/applications/pcsx2-qt.desktop
	rm debian/pcsx2/usr/share/PCSX2/resources/icons/flags/LICENSE
	rm debian/pcsx2/usr/share/PCSX2/resources/sounds/achievements/README.txt
