From ae826fde04191d26af68b898cf4b2f537d24a8ec Mon Sep 17 00:00:00 2001 From: StevenWdV Date: Tue, 14 Dec 2021 15:56:10 +0100 Subject: Add Swift wrapper, support more platforms in Makefile --- wrappers/swift/Makefile | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 wrappers/swift/Makefile (limited to 'wrappers/swift/Makefile') diff --git a/wrappers/swift/Makefile b/wrappers/swift/Makefile new file mode 100644 index 0000000..cf117f3 --- /dev/null +++ b/wrappers/swift/Makefile @@ -0,0 +1,31 @@ +.PHONY: build test clean + +ifneq (clean,$(MAKECMDGOALS)) +GOOS != go env GOHOSTOS +GOARCH != go env GOHOSTARCH + +ifeq (Windows_NT,$(OS)) +export PATH := $(PATH):$(abspath ../../exports/$(GOOS)/$(GOARCH)) +else +export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH):$(abspath ../../exports/$(GOOS)/$(GOARCH)) +endif +endif + +build: + $(MAKE) -C ../../exports +ifeq (Windows_NT,$(OS)) + "$(COMSPEC)" /c "\".\\fix-path.cmd & swift build --configuration release -Xlinker -L^\"../../exports/$(GOOS)/$(GOARCH)^\"\"" +else + swift build --configuration release -Xlinker -L"../../exports/$(GOOS)/$(GOARCH)" +endif + +test: + $(MAKE) -C ../../exports +ifeq (Windows_NT,$(OS)) + "$(COMSPEC)" /c "\".\\fix-path.cmd & swift test --parallel -Xlinker -L^\"../../exports/$(GOOS)/$(GOARCH)^\"\"" +else + swift test --parallel -Xlinker -L"../../exports/$(GOOS)/$(GOARCH)" +endif + +clean: + rm -rf .build/ -- cgit v1.2.3