#!/usr/bin/make -f

%:
	dh $@ --builddir build/ --buildsystem=cmake+ninja

NEO_DISABLE_BUILTINS_COMPILATION ?= FALSE
RELEASE_WITH_REGKEYS ?= FALSE
IGDRCL_FORCE_USE_LIBVA ?= FALSE
NEO_SKIP_UNIT_TESTS ?= FALSE
NEO_ENABLE_i915_PRELIM_DETECTION ?= TRUE

override_dh_auto_configure:
	dh_auto_configure -- ${NEO_BUILD_EXTRA_OPTS} \
		-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
		-DNEO_OCL_VERSION_MAJOR=${NEO_OCL_VERSION_MAJOR} \
		-DNEO_OCL_VERSION_MINOR=${NEO_OCL_VERSION_MINOR} \
		-DNEO_VERSION_BUILD=${NEO_OCL_VERSION_BUILD} \
		-DDO_NOT_RUN_AUB_TESTS=${DO_NOT_RUN_AUB_TESTS} \
		-DNEO_SKIP_UNIT_TESTS=${NEO_SKIP_UNIT_TESTS} \
		-DNEO_ENABLE_i915_PRELIM_DETECTION=${NEO_ENABLE_i915_PRELIM_DETECTION} \
		-DNEO_DISABLE_BUILTINS_COMPILATION=${NEO_DISABLE_BUILTINS_COMPILATION} \
		-DBUILD_WITH_L0=FALSE \
		-DRELEASE_WITH_REGKEYS=${RELEASE_WITH_REGKEYS} \
		-DIGDRCL_FORCE_USE_LIBVA=${IGDRCL_FORCE_USE_LIBVA} \
		-Wno-dev

override_dh_auto_build:
	${BUILD_PREFIX} dh_auto_build

override_dh_install:
	rm -rvf debian/intel-opencl-icd/usr/lib/debug
	dh_install

override_dh_builddeb:
	dh_builddeb -- -Zxz

override_dh_auto_test:
	echo "ULTs already executed"
