#!/usr/bin/make -f
include /usr/share/dpkg/architecture.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=+lto

# need gcc 12.1 for mold to be able to process --gdb-index
export CC=gcc-12
export CXX=g++-12

%:
	dh $@ --with pkgkde_symbolshelper --buildsystem=cmake+ninja

override_dh_auto_configure:
	dh_auto_configure -- \
		-DCMAKE_MESSAGE_LOG_LEVEL=STATUS \
		-DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) \
		-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
		-DQT_UNITY_BUILD=ON \
		$(extra_cmake_args)
