Limit parallel builds on Ubuntu
authorGianfranco Costamagna <locutusofborg@debian.org>
Tue, 11 Sep 2018 19:11:34 +0000 (21:11 +0200)
committerJochen Sprickerhof <git@jochen.sprickerhof.de>
Tue, 11 Sep 2018 19:56:39 +0000 (21:56 +0200)
Limit to 2 on amd64, arm64 and ppc64el (they go OOM).

debian/rules

index 32b4fd97b0f52a1920d1548c0260bb6f5b677f9a..c0391a1e69ca08056a21fff8397cecf20e84bd3e 100755 (executable)
@@ -16,6 +16,18 @@ ifneq (,$(filter $(DEB_BUILD_ARCH),mips mipsel))
        CXXFLAGS+=--param ggc-min-expand=20
 endif
 
+ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes)
+        ifeq ($(DEB_HOST_ARCH),amd64)
+                export DEB_BUILD_MAINT_OPTIONS=parallel=2
+        endif
+        ifeq ($(DEB_HOST_ARCH),arm64)
+                export DEB_BUILD_MAINT_OPTIONS=parallel=2
+        endif
+        ifeq ($(DEB_HOST_ARCH),ppc64el)
+                export DEB_BUILD_MAINT_OPTIONS=parallel=2
+        endif
+endif
+
 BUILD_DOC = $(if $(shell dh_listpackages | grep libpcl-doc),-DWITH_DOCS=ON)
 
 # Multiarch.