Disable static linking to Swift standard libraries

According to Apple: Swift compiler no longer supports statically linking the Swift libraries. They're included in the OS by default starting with macOS Mojave 10.14.4. For macOS Mojave 10.14.3 and earlier, there's an optional Swift library package that can be downloaded from "More Downloads" for Apple Developers at https://developer.apple.com/download/more/
This commit is contained in:
Star Brilliant 2019-05-14 01:36:10 +08:00
parent ebba9c8ef5
commit 81f1cfba5d

View File

@ -3,17 +3,10 @@
SWIFTC = swiftc
PREFIX = /usr/local
SWIFTC_VERS = $(shell swiftc -version | grep -i swift | awk 'match($$0, /[0-9]/) {print substr($$0, RSTART, RLENGTH) }')
all: doh-logger
$(info SWIFTC_VERS="$(SWIFTC_VERS)")
doh-logger: doh-logger.swift
ifeq ($(SWIFTC_VERS), 5)
$(SWIFTC) -o $@ -O $<
else
$(SWIFTC) -o $@ -O -static-stdlib $<
endif
$(SWIFTC) -o $@ -O $<
clean:
rm -f doh-logger