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

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

include /usr/share/dpkg/buildflags.mk
# see FEATURE AREAS in dpkg-buildflags(1)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes)
DH_ADDONS := --with apport
CMAKE_FLAGS := \
    -DREPOWERD_ENABLE_HYBRIS=ON \
    -DREPOWERD_ENABLE_BINDER=ON
else
CMAKE_FLAGS := \
    -DREPOWERD_ENABLE_HYBRIS=OFF \
    -DREPOWERD_ENABLE_BINDER=OFF
endif

%:
	dh $@ $(DH_ADDONS)

override_dh_auto_configure:
	dh_auto_configure -- \
	    $(CMAKE_FLAGS) \
	    -DENABLE_WERROR=ON \
	    -DREPOWERD_DISABLE_TIME_SENSITIVE_TESTS=ON
