From 65ef30eb1dcd97ab21addf8f2bf78ba50eaacbbd Mon Sep 17 00:00:00 2001 From: Chen-I Lim <46905241+chenilim@users.noreply.github.com> Date: Thu, 30 Jun 2022 14:44:47 -0700 Subject: [PATCH] Fix #3277 (#3308) --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 3df233288..c8a1ec414 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,12 @@ server: ## Build server for local environment. server-mac: ## Build server for Mac. mkdir -p bin/mac $(eval LDFLAGS += -X "github.com/mattermost/focalboard/server/model.Edition=mac") +ifeq ($(FB_PROD),) cd server; env GOOS=darwin GOARCH=$(MAC_GO_ARCH) go build -ldflags '$(LDFLAGS)' -tags '$(BUILD_TAGS)' -o ../bin/mac/focalboard-server ./main +else +# Always build x86 for production, to work on both Apple Silicon and legacy Macs + cd server; env GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 go build -ldflags '$(LDFLAGS)' -tags '$(BUILD_TAGS)' -o ../bin/mac/focalboard-server ./main +endif server-linux: ## Build server for Linux. mkdir -p bin/linux