From 24533d2c5d86857dbb2f75f171430da7073ce65c Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Tue, 2 Oct 2018 18:38:03 -0700 Subject: Make the macOS bundle compatible osx 10.12 On macOS 10.12.6, running `make app` creates a bundle that refuses to start (it complains application is only compatible with more recent versions of macOS). The binary works great when running it directly. To resolve this, the `MACOSX_DEPLOYMENT_TARGET` environment variable is now set automatically from the makefile. This allows building on macOS 10.12 and earlier, without negatively impacting the later versions of macOS. --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index dad41131..42b51c7a 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,8 @@ APP_DIR = $(RELEASE_DIR)/osx APP_BINARY = $(RELEASE_DIR)/$(TARGET) APP_BINARY_DIR = $(APP_DIR)/$(APP_NAME)/Contents/MacOS +export MACOSX_DEPLOYMENT_TARGET = $(shell defaults read loginwindow SystemVersionStampAsString) + DMG_NAME = Alacritty.dmg DMG_DIR = $(RELEASE_DIR)/osx @@ -22,6 +24,9 @@ help: ## Prints help for targets with comments binary: | $(TARGET) ## Build release binary with cargo $(TARGET): +ifneq ( "${MACOSX_DEPLOYMENT_TARGET}" , "") + @echo MACOSX_DEPLOYMENT_TARGET=$${MACOSX_DEPLOYMENT_TARGET} +endif cargo build --release app: | $(APP_NAME) ## Clone Alacritty.app template and mount binary -- cgit v1.2.3