File tree Expand file tree Collapse file tree 3 files changed +37
-4
lines changed Expand file tree Collapse file tree 3 files changed +37
-4
lines changed Original file line number Diff line number Diff line change @@ -676,6 +676,35 @@ jobs:
676676 -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
677677 cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
678678
679+ macOS-latest-cmake-visionos :
680+ runs-on : macos-latest
681+
682+ steps :
683+ - name : Clone
684+ id : checkout
685+ uses : actions/checkout@v4
686+
687+ - name : Dependencies
688+ id : depends
689+ continue-on-error : true
690+ run : |
691+ brew update
692+
693+ - name : Build
694+ id : cmake_build
695+ run : |
696+ sysctl -a
697+ cmake -B build -G Xcode \
698+ -DGGML_METAL_USE_BF16=ON \
699+ -DGGML_METAL_EMBED_LIBRARY=ON \
700+ -DLLAMA_BUILD_EXAMPLES=OFF \
701+ -DLLAMA_BUILD_TESTS=OFF \
702+ -DLLAMA_BUILD_SERVER=OFF \
703+ -DCMAKE_SYSTEM_NAME=visionOS \
704+ -DCMAKE_OSX_DEPLOYMENT_TARGET=1.0 \
705+ -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
706+ cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
707+
679708 macOS-latest-swift :
680709 runs-on : macos-latest
681710
Original file line number Diff line number Diff line change @@ -432,8 +432,8 @@ cmake -B build-visionos -G Xcode \
432432 -DCMAKE_SYSTEM_NAME=visionOS \
433433 -DCMAKE_OSX_SYSROOT=xros \
434434 -DCMAKE_XCODE_ATTRIBUTE_SUPPORTED_PLATFORMS=xros \
435- -DCMAKE_C_FLAGS=" -D_XOPEN_SOURCE=700 -Du_int=unsigned\ int -Du_char=unsigned\ char -Du_short=unsigned\ short ${COMMON_C_FLAGS} " \
436- -DCMAKE_CXX_FLAGS=" -D_XOPEN_SOURCE=700 -Du_int=unsigned\ int -Du_char=unsigned\ char -Du_short=unsigned\ short ${COMMON_CXX_FLAGS} " \
435+ -DCMAKE_C_FLAGS=" -D_XOPEN_SOURCE=700 ${COMMON_C_FLAGS} " \
436+ -DCMAKE_CXX_FLAGS=" -D_XOPEN_SOURCE=700 ${COMMON_CXX_FLAGS} " \
437437 -S .
438438cmake --build build-visionos --config Release -- -quiet
439439
@@ -445,8 +445,8 @@ cmake -B build-visionos-sim -G Xcode \
445445 -DCMAKE_SYSTEM_NAME=visionOS \
446446 -DCMAKE_OSX_SYSROOT=xrsimulator \
447447 -DCMAKE_XCODE_ATTRIBUTE_SUPPORTED_PLATFORMS=xrsimulator \
448- -DCMAKE_C_FLAGS=" -D_XOPEN_SOURCE=700 -Du_int=unsigned\ int -Du_char=unsigned\ char -Du_short=unsigned\ short ${COMMON_C_FLAGS} " \
449- -DCMAKE_CXX_FLAGS=" -D_XOPEN_SOURCE=700 -Du_int=unsigned\ int -Du_char=unsigned\ char -Du_short=unsigned\ short ${COMMON_CXX_FLAGS} " \
448+ -DCMAKE_C_FLAGS=" -D_XOPEN_SOURCE=700 ${COMMON_C_FLAGS} " \
449+ -DCMAKE_CXX_FLAGS=" -D_XOPEN_SOURCE=700 ${COMMON_CXX_FLAGS} " \
450450 -S .
451451cmake --build build-visionos-sim --config Release -- -quiet
452452
Original file line number Diff line number Diff line change @@ -325,6 +325,10 @@ if (CMAKE_SYSTEM_NAME MATCHES "Android")
325325 target_link_libraries (ggml-base PRIVATE dl)
326326endif ()
327327
328+ if (CMAKE_SYSTEM_NAME MATCHES "visionOS" )
329+ target_compile_definitions (ggml-base PUBLIC _DARWIN_C_SOURCE)
330+ endif ()
331+
328332if (BUILD_SHARED_LIBS )
329333 foreach (target ggml-base ggml)
330334 set_target_properties (${target} PROPERTIES POSITION_INDEPENDENT_CODE ON )
You can’t perform that action at this time.
0 commit comments