#!/usr/bin/make -f

ifeq (,$(filter-out armel powerpc,$(DEB_BUILD_ARCH)))
        export DEB_LDFLAGS_MAINT_APPEND = -latomic
endif

export CC = clang
export CXX = clang++

# Source
# https://github.com/apple/swift-corelibs-libdispatch/releases/tag/swift-5.4.2-RELEASE

%:
	dh $@ -Scmake+ninja

ifneq (,$(filter $(DEB_HOST_ARCH), armhf))
override_dh_dwz:

override_dh_auto_test:
endif

override_dh_auto_configure:
	dh_auto_configure -- \
	-DCMAKE_BUILD_TYPE=RelWithDebInfo \
	-DBUILD_SHARED_LIBS=ON

override_dh_clean:
	dh_clean dispatch/module.modulemap private/module.modulemap

# No dbgsym packages:
override_dh_strip:
	dh_strip --no-automatic-dbgsym
