From d082c229e9cd54b061977be7c300053f923bafcb Mon Sep 17 00:00:00 2001 From: Andrea Pappacoda Date: Fri, 20 Jan 2023 10:25:03 +0100 Subject: [PATCH] d/rules: build tests even if x86-64-v2 is not supported If nocheck is not set, tests are always built but only run after checking if the build CPU has all the x86-64-v2 features in the override_dh_auto_test step. --- debian/rules | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/debian/rules b/debian/rules index a0e932f..7870d01 100755 --- a/debian/rules +++ b/debian/rules @@ -32,19 +32,12 @@ ifeq ($(DEB_HOST_ARCH_CPU),amd64) export DEB_CXXFLAGS_MAINT_APPEND = -march=x86-64-v2 endif -test := true ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) - ifeq ($(DEB_HOST_ARCH_CPU),amd64) - ifeq (,$(shell lscpu | awk '/cx16/ && /lahf/ && /popcnt/ && /sse3/ && /sse4_1/ && /sse4_2/ && /ssse3/')) - $(warning Your CPU doesn't support the x86-64-v2 micro-architecture level. Tests will be skipped.) - test := false - endif - endif + test := true else test := false endif - ifeq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) build_type := Release lto := true @@ -80,5 +73,13 @@ override_dh_auto_configure: -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=$(lto) \ -DCMAKE_POLICY_DEFAULT_CMP0069=NEW +override_dh_auto_test: + supports_x86_64_v2=$$(lscpu | awk '/cx16/ && /lahf/ && /popcnt/ && /sse3/ && /sse4_1/ && /sse4_2/ && /ssse3/' | tr -d '[:space:]') ; \ + if [ '$(DEB_HOST_BUILD_CPU)' = amd64 ] && [ -z "$$supports_x86_64_v2" ]; then \ + echo "Your CPU doesn't support the x86-64-v2 micro-architecture level. Tests will be skipped." ; \ + else \ + dh_auto_test ; \ + fi + execute_after_dh_auto_clean: $(RM) externals/sirit