From c930ac23a11311a04957e19c03b7419cf5ddaf21 Mon Sep 17 00:00:00 2001 From: Artur Date: Thu, 9 Feb 2023 14:03:56 +0200 Subject: [PATCH 1/2] build fat-mach-o binary for pygore --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ccfcc08..af0aea9 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,6 @@ WINDOWS_BUILD_FOLDER=build/windows TAR_ARGS=cfz RELEASE_FILES=LICENSE README.md -ARCH=GOARCH=amd64 CGO=CGO_ENABLED=1 BUILD_OPTS=-ldflags="-s -w" -buildmode=c-shared WINDOWS_GO_ENV=GOOS=windows $(ARCH) $(CGO) CC=x86_64-w64-mingw32-gcc @@ -47,7 +46,10 @@ help: .PHONY: darwin darwin: ## Make binary for macOS @echo -e "$(OK_COLOR)[$(APP)] Build for macOS$(NO_COLOR)" - @$(DARWIN_GO_ENV) $(GO) build -o $(APP).dylib $(BUILD_OPTS) . + @GOARCH=amd64 $(DARWIN_GO_ENV) $(GO) build -o $(APP).amd64.dylib $(BUILD_OPTS) . + @GOARCH=arm64 $(DARWIN_GO_ENV) $(GO) build -o $(APP).arm64.dylib $(BUILD_OPTS) . + @lipo -create -output $(APP).dylib $(APP).amd64.dylib $(APP).arm64.dylib + @rm $(APP).amd64.dylib $(APP).arm64.dylib .PHONY: windows windows: ## Make binary for Windows From bcd81499dcee2aea03bca686b45275735e31e13f Mon Sep 17 00:00:00 2001 From: Artur Avetisyan <55391021+3viLMonk3y@users.noreply.github.com> Date: Sun, 9 Apr 2023 20:30:56 +0300 Subject: [PATCH 2/2] revert setting ARCH parameter revert setting ARCH parameter, delete $(ARCH) from DARWIN_GO_ENV --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index af0aea9..2937909 100644 --- a/Makefile +++ b/Makefile @@ -30,11 +30,12 @@ WINDOWS_BUILD_FOLDER=build/windows TAR_ARGS=cfz RELEASE_FILES=LICENSE README.md +ARCH=GOARCH=amd64 CGO=CGO_ENABLED=1 BUILD_OPTS=-ldflags="-s -w" -buildmode=c-shared WINDOWS_GO_ENV=GOOS=windows $(ARCH) $(CGO) CC=x86_64-w64-mingw32-gcc LINUX_GO_ENV=GOOS=linux $(ARCH) $(CGO) -DARWIN_GO_ENV=GOOS=darwin $(ARCH) $(CGO) +DARWIN_GO_ENV=GOOS=darwin $(CGO) .DEFAULT_GOAL := help