1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=+lto
DPKG_EXPORT_BUILDFLAGS = 1
ifneq (nodoc,$(findstring nodoc,$(DEB_BUILD_OPTIONS)))
BUILD_DOC=ON
else
BUILD_DOC=OFF
endif
ifneq (nocheck,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
BUILD_TESTS=ON
else
BUILD_TESTS=OFF
endif
# 32bit machines do not have __{,u}int128_t
# now they are already excluded by B-D architecture-is-64bit
# due to precision issues (could not pass unit tests)
ifneq (64,$(DEB_BUILD_ARCH_BITS))
BUILD_INTSQRT=OFF
else
BUILD_INTSQRT=ON
endif
include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/buildopts.mk
include /usr/share/dpkg/pkg-info.mk
TARGET_LIBDIR = /usr/lib/$(DEB_HOST_MULTIARCH)
BUILDDIR = build
%:
dh $@ --buildsystem=cmake+ninja --builddir=$(BUILDDIR)
override_dh_auto_configure:
dh_auto_configure -- -DBUILD_SHARED_LIBS=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DBUILD_LIBS=ON -DBUILD_TESTS=$(BUILD_TESTS) -DENABLE_INLINING=ON \
-DENABLE_INTSQRT=$(BUILD_INTSQRT) -DENABLE_DOXYGEN=$(BUILD_DOC)
override_dh_auto_test:
ifeq ($(BUILD_TESTS), ON)
# all tests are single-threaded and slow
cd $(BUILDDIR) && env CTEST_PARALLEL_LEVEL=$(DEB_BUILD_OPTION_PARALLEL) ctest -E ".*noopt"
endif
|