From 3ee1e9cd7420ece1e67e7e007615444835c26f48 Mon Sep 17 00:00:00 2001 From: Anass Zurba Date: Thu, 10 Oct 2024 14:27:41 +0300 Subject: [PATCH] Makefile: fix compilation on linux for Swift 6. as specified in https://github.com/swiftlang/swift-package-manager/pull/2787/commits/d1fdbbfef0aec0bf6c5a0bff5e9c2c9bf23c6bb5 passing multiple archs is intended to allow compiling universal binaries in macOS. When compiling for Swift 6, passing these arguments in linux fails due to the lack of xcode. For some reason this didn't prevent building prior to Swift 6. --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 0ed134c..877d3a9 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,7 @@ UNAME_S := $(shell uname -s) ifeq ($(UNAME_S), Darwin) BUILD_PATH_PREFIX := .build/apple/Products/Release -endif -ifeq ($(UNAME_S), Linux) +else ifeq ($(UNAME_S), Linux) BUILD_PATH_PREFIX := .build/release endif @@ -25,7 +24,11 @@ install: build cp -f $(BUILD_PATH) $(INSTALL_PATH) build: +ifeq ($(UNAME_S), Darwin) swift build --disable-sandbox -c release --arch arm64 --arch x86_64 +else ifeq ($(UNAME_S), Linux) + swift build --disable-sandbox -c release +endif uninstall: rm -f $(INSTALL_PATH)