#!/usr/bin/make -f

# The package ships the architecture independent library.
CMAKE_FLAGS = -DCMAKE_INSTALL_LIBDIR=lib -DINTERNAL_EXPECTED=OFF
ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
  CMAKE_FLAGS += -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF
endif

# Put the generated code to a cleanable temporary directory.
CMAKE_FLAGS += -DGENERATED_DIR=$(CURDIR)/debian/tmp

# Search Girs in the arch-dependent directory as well.
CMAKE_FLAGS += -DGIR_DIR=/usr/lib/${DEB_HOST_MULTIARCH}/gir-1.0

# Disable predefined macros outside the reserved namespace
# so stringification with preprocessor can work okay.
CMAKE_FLAGS += -DCMAKE_CXX_EXTENSIONS=OFF

export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow
export GI_DEBUG = 1  # suppress warnings from a cppgir call

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- $(CMAKE_FLAGS)
