Created
December 29, 2021 08:48
-
-
Save dduan/4df72c12f4b4ef8ad1c5562eae5bb40f to your computer and use it in GitHub Desktop.
How to link to libdispatch on Linux - an example Makefile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHELL = /bin/bash | |
ifeq ($(shell uname),Darwin) | |
EXTRA_SWIFT_FLAGS = "--disable-sandbox" | |
else | |
SWIFT_TOOLCHAIN = "$(shell dirname $(shell swift -print-target-info | grep runtimeResourcePath | cut -f 2 -d ':' | cut -f 2 -d '"'))" | |
EXTRA_SWIFT_FLAGS = -Xcxx -I${SWIFT_TOOLCHAIN}/swift -Xcxx -I${SWIFT_TOOLCHAIN}/swift/Block | |
endif | |
.PHONY: test | |
test: | |
@swift test ${EXTRA_SWIFT_FLAGS} | |
.PHONY: build | |
build: | |
@swift build --configuration release -Xswiftc -warnings-as-errors ${EXTRA_SWIFT_FLAGS} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment