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