From e2eed4e70d800bbacf9af125c48a4fe23919bdc9 Mon Sep 17 00:00:00 2001 From: Danny Canter Date: Fri, 3 Apr 2026 11:21:03 -0700 Subject: [PATCH] makefile: Don't point to /usr/bin/swift on non-macOS We hardocde /usr/bin/swift to point to your xcodes swift for the host code. This isn't the usual path on other OS'. --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f5b47124..576e7c73 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,13 @@ WARNINGS_AS_ERRORS ?= true SWIFT_CONFIGURATION := $(if $(filter-out false,$(WARNINGS_AS_ERRORS)),-Xswiftc -warnings-as-errors) --disable-automatic-resolution # Commonly used locations -SWIFT := "/usr/bin/swift" +UNAME_S := $(shell uname -s) +ifeq ($(UNAME_S),Darwin) +SWIFT ?= /usr/bin/swift +else +SWIFT ?= swift +endif + ROOT_DIR := $(shell git rev-parse --show-toplevel) BUILD_BIN_DIR = $(shell $(SWIFT) build -c $(BUILD_CONFIGURATION) --show-bin-path) COV_DATA_DIR = $(shell $(SWIFT) test --show-coverage-path | xargs dirname)