#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
ifneq (,$(filter $(DEB_HOST_ARCH),amd64))
BUILD_TESTING = ON
else
BUILD_TESTING = OFF
endif

%:
	dh $@ -Scmake -Bbuild --with python3

override_dh_auto_configure:
	dh_auto_configure -- \
		-DFAISS_ENABLE_GPU=OFF \
		-DFAISS_USE_SYSTEM_GTEST=ON \
		-DBUILD_TESTING=$(BUILD_TESTING)

execute_after_dh_auto_install:
	cd build/faiss/python; \
		python3 setup.py install --install-layout=deb \
		--root=$(shell pwd)/debian/python3-faiss/
