#!/usr/bin/make -f

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

%:
	dh $@ --buildsystem=cmake  --builddirectory=build

override_dh_auto_configure:
	dh_auto_configure -- \
				-DSPIRV_REFLECT_BUILD_TESTS="ON" \
				-DSPIRV_REFLECT_STATIC_LIB="ON"

execute_after_dh_auto_build:
	# Generate the manpages
	help2man --name="SPIRV-Reflect" --version-string=${DEB_VERSION_UPSTREAM} bin/spirv-reflect > spirv-reflect.1
	help2man --name="SPIRV-Reflect" --version-string=${DEB_VERSION_UPSTREAM} bin/spirv-reflect-pp > spirv-reflect-pp.1

execute_before_dh_auto_test:
	# Run the tests included in the package, they are not triggered by default
	(cd build && ./test-spirv-reflect)
