Skip to content

Commit 4b78c4c

Browse files
committed
[examples/swift] add to root makefile when running on macOS to include in CI
1 parent 420486b commit 4b78c4c

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Makefile

+10-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ ifneq '' '$(or $(filter clean,$(MAKECMDGOALS)),$(LLAMA_METAL))'
5454
BUILD_TARGETS += metal
5555
endif
5656

57+
ifeq ($(UNAME_S),Darwin)
58+
BUILD_TARGETS += swift
59+
endif
60+
5761
default: $(BUILD_TARGETS)
5862

5963
test: $(TEST_TARGETS)
@@ -617,6 +621,11 @@ metal: examples/metal/metal.cpp ggml.o $(OBJS)
617621
$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
618622
endif
619623

624+
ifeq ($(UNAME_S),Darwin)
625+
swift: examples/swift
626+
cd examples/swift && make build && cd -
627+
endif
628+
620629
build-info.h: $(wildcard .git/index) scripts/build-info.sh
621630
@sh scripts/build-info.sh $(CC) > $@.tmp
622631
@if ! cmp -s $@.tmp $@; then \
@@ -637,7 +646,7 @@ benchmark-matmult: examples/benchmark/benchmark-matmult.cpp build-info.h ggml.o
637646
run-benchmark-matmult: benchmark-matmult
638647
./$@
639648

640-
.PHONY: run-benchmark-matmult
649+
.PHONY: run-benchmark-matmult swift
641650

642651
vdot: pocs/vdot/vdot.cpp ggml.o $(OBJS)
643652
$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)

examples/swift/Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import PackageDescription
55

66
let package = Package(
77
name: "swift",
8-
platforms: [.macOS(.v11)],
8+
platforms: [.macOS(.v12)],
99
dependencies: [
1010
.package(name: "llama", path: "../../"),
1111
],

0 commit comments

Comments
 (0)