-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (25 loc) · 986 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
all: debug
SWIFT_FLAGS :=
# Check for the availability of EKAuthorizationStatus.fullAccess and set SWIFT_FLAGS accordingly
check_evkit:
@if swift probes/check_ekauth.swift 2>/dev/null ; then \
echo "EKAuthorizationStatus.fullAccess is available"; \
SWIFT_FLAGS=""; \
else \
echo "EKAuthorizationStatus.fullAccess is not available"; \
SWIFT_FLAGS="-Xswiftc -DOLD_EVKIT"; \
fi
echo "SWIFT_FLAGS: $(SWIFT_FLAGS)"
# Export SWIFT_FLAGS so it's available in all targets
export SWIFT_FLAGS
# Build the debug version
debug: check_evkit
xcrun swift build $$SWIFT_FLAGS
@echo "Built for debugging. See ./.build/debug/icaltoday"
# Build the release version
release: check_evkit Sources/icaltoday/icaltoday.swift
xcrun swift build -c release --arch arm64 --arch x86_64 $$SWIFT_FLAGS
@echo "Built for release. See .build/apple/Products/Release/icaltoday"
# Run tests with the SWIFT_FLAGS
test: check_evkit
xcrun swift test $$SWIFT_FLAGS