Skip to content

Commit

Permalink
Make Makefile compatible with swift5 and older swift versions
Browse files Browse the repository at this point in the history
  • Loading branch information
modib committed May 10, 2019
1 parent 2332d9b commit 1642730
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion darwin-wrapper/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@
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
$(SWIFTC) -o $@ -O -static-stdlib $<
ifeq ($(SWIFTC_VERS), 5)
$(SWIFTC) -o $@ -O $<
else
$(SWIFTC) -o $@ -O -static-stdlib $<
endif

clean:
rm -f doh-logger
Expand Down

0 comments on commit 1642730

Please sign in to comment.