#!/usr/bin/make -f
# -*- makefile -*-

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

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# These reproduce the generated files removed from the sources. debian/copyright
# contains the list of the removed files. The commands to regenerate these are
# in the comment of each removed file in the upstream tree
override_dh_auto_build:
	cd include/etl/generators && sh generate.bat
	dh_auto_build

	$(if $(filter nodoc,$(DEB_BUILD_OPTIONS)),,doxygen Doxyfile)

%:
	dh $@ --buildsystem=cmake

override_dh_auto_install:
	dh_auto_install
	rm -rf debian/tmp/usr/include/etl/.vscode*

override_dh_auto_configure:
	dh_auto_configure -- \
                -DETL_VERSION=$(patsubst %+dfsg,%,$(DEB_VERSION_UPSTREAM)) \
                -DBUILD_TESTS=$(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),OFF,ON) \
                -DETL_ENABLE_SANITIZER=OFF \
                -DCMAKE_CXX_FLAGS="-Wno-aggressive-loop-optimizations -Wno-pessimizing-move" # for gcc-13 compat
