diff options
| author | StevenWdV <stevenwdv@gmail.com> | 2021-12-14 15:56:10 +0100 |
|---|---|---|
| committer | StevenWdV <stevenwdv@gmail.com> | 2021-12-14 15:56:10 +0100 |
| commit | ae826fde04191d26af68b898cf4b2f537d24a8ec (patch) | |
| tree | c41943907e6c880a4254106942fc2c399c462016 /wrappers/swift/Makefile | |
| parent | d9953dcc09ce61e249e40857bbf5cb98e0bb1fbf (diff) | |
Add Swift wrapper, support more platforms in Makefile
Diffstat (limited to 'wrappers/swift/Makefile')
| -rw-r--r-- | wrappers/swift/Makefile | 31 |
1 files changed, 31 insertions, 0 deletions
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/ |
