Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 75fc48a

Browse files
authored
Merge pull request #489 from janhq/482-refactor-build-workflows
chore: Refactor `workflows/build.yml` and remove manual build flags
2 parents 540601a + ed16d4a commit 75fc48a

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ jobs:
285285
run: |
286286
./install_deps.sh
287287
mkdir build && cd build
288-
cmake -DLLAMA_METAL_EMBED_LIBRARY=ON -DWHISPER_COREML=1 -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} ..
288+
cmake -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} ..
289289
CC=gcc-8 make -j $(sysctl -n hw.ncpu)
290290
ls -la
291291
@@ -352,7 +352,7 @@ jobs:
352352
run: |
353353
./install_deps.sh
354354
mkdir build && cd build
355-
cmake -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} -DLLAMA_METAL=OFF ..
355+
cmake -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} ..
356356
CC=gcc-8 make -j $(sysctl -n hw.ncp)
357357
ls -la
358358

CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@ if(NOT DEFINED NITRO_VERSION)
4242
set(NITRO_VERSION "default_version")
4343
endif()
4444

45+
if(APPLE)
46+
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm.*|ARM64)$")
47+
# MacOS silicon
48+
set(LLAMA_METAL_EMBED_LIBRARY ON)
49+
set(WHISPER_COREML 1)
50+
else()
51+
# MacOS amd64
52+
set(LLAMA_METAL OFF)
53+
endif()
54+
endif()
55+
4556
add_compile_definitions(NITRO_VERSION="${NITRO_VERSION}")
4657

4758
add_subdirectory(llama.cpp/examples/llava)

0 commit comments

Comments
 (0)