Skip to content

Commit

Permalink
[examples/swift] add to root makefile when running on macOS to includ…
Browse files Browse the repository at this point in the history
…e in CI
  • Loading branch information
zshannon committed Oct 10, 2023
1 parent 420486b commit 4b78c4c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ ifneq '' '$(or $(filter clean,$(MAKECMDGOALS)),$(LLAMA_METAL))'
BUILD_TARGETS += metal
endif

ifeq ($(UNAME_S),Darwin)
BUILD_TARGETS += swift
endif

default: $(BUILD_TARGETS)

test: $(TEST_TARGETS)
Expand Down Expand Up @@ -617,6 +621,11 @@ metal: examples/metal/metal.cpp ggml.o $(OBJS)
$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
endif

ifeq ($(UNAME_S),Darwin)
swift: examples/swift
cd examples/swift && make build && cd -
endif

build-info.h: $(wildcard .git/index) scripts/build-info.sh
@sh scripts/build-info.sh $(CC) > $@.tmp
@if ! cmp -s $@.tmp $@; then \
Expand All @@ -637,7 +646,7 @@ benchmark-matmult: examples/benchmark/benchmark-matmult.cpp build-info.h ggml.o
run-benchmark-matmult: benchmark-matmult
./$@

.PHONY: run-benchmark-matmult
.PHONY: run-benchmark-matmult swift

vdot: pocs/vdot/vdot.cpp ggml.o $(OBJS)
$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
Expand Down
2 changes: 1 addition & 1 deletion examples/swift/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PackageDescription

let package = Package(
name: "swift",
platforms: [.macOS(.v11)],
platforms: [.macOS(.v12)],
dependencies: [
.package(name: "llama", path: "../../"),
],
Expand Down

0 comments on commit 4b78c4c

Please sign in to comment.