#!/usr/bin/make -f
export DH_VERBOSE = 1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
export DEB_LDFLAGS_MAINT_APPEND = -Wl,-O1
export DEB_CMAKE_ARGS = \
	-DBUILD_SHARED_LIBS=ON \
	-DENABLE_ROARING_TESTS=OFF \
	-DROARING_USE_CPM=OFF
export DEB_GENSYMBOLS_CHECK_LEVEL = 4

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
	      -DCMAKE_LIBRARY_ARCHITECTURE="$(DEB_TARGET_MULTIARCH)" $(DEB_CMAKE_ARGS)

override_dh_auto_clean:
	dh_auto_clean $@
	rm -f tests/config.h

# Since we exclude realdata from archive, do not run ctest for it
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	dh_auto_test -- ARGS+="-E realdata_unit"
endif
