Skip to content

Commit

Permalink
build: use cmake preset in github action
Browse files Browse the repository at this point in the history
  • Loading branch information
Adriankhl committed Jun 6, 2024
1 parent 00fe860 commit 84bea08
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
27 changes: 15 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. -GNinja -DLLAMA_NATIVE=OFF -DLLAMA_VULKAN=OFF -DCMAKE_BUILD_TYPE=Release
cmake .. --preset linux-cpu-release
ninja -j $(nproc)
- name: Archive library
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. -GNinja -DLLAMA_NATIVE=OFF -DLLAMA_VULKAN=OFF -DCMAKE_BUILD_TYPE=Debug
cmake .. --preset linux-cpu-debug
ninja -j $(nproc)
- name: Archive library
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. -GNinja -DLLAMA_NATIVE=OFF -DLLAMA_VULKAN=ON -DCMAKE_BUILD_TYPE=Release
cmake .. --preset linux-vulkan-release
ninja -j $(nproc)
- name: Archive library
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. -GNinja -DLLAMA_NATIVE=OFF -DLLAMA_VULKAN=ON -DCMAKE_BUILD_TYPE=Debug
cmake .. --preset linux-vulkan-debug
ninja -j $(nproc)
- name: Archive library
Expand Down Expand Up @@ -164,7 +164,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. -GNinja -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DLLAMA_NATIVE=OFF -DLLAMA_VULKAN=OFF -DCMAKE_BUILD_TYPE=Release
cmake .. --preset windows-cpu-release
ninja -j ${env:NUMBER_OF_PROCESSORS}
- name: Archive library
Expand Down Expand Up @@ -199,7 +199,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. -GNinja -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DLLAMA_NATIVE=OFF -DLLAMA_VULKAN=OFF -DCMAKE_BUILD_TYPE=Debug
cmake .. --preset windows-cpu-debug
ninja -j ${env:NUMBER_OF_PROCESSORS}
- name: Archive library
Expand Down Expand Up @@ -246,6 +246,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. --preset windows-vulkan-release
cmake .. -GNinja -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DLLAMA_NATIVE=OFF -DLLAMA_VULKAN=ON -DCMAKE_BUILD_TYPE=Release
ninja -j ${env:NUMBER_OF_PROCESSORS}
Expand Down Expand Up @@ -293,7 +294,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. -GNinja -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DLLAMA_NATIVE=OFF -DLLAMA_VULKAN=ON -DCMAKE_BUILD_TYPE=Debug
cmake .. --preset windows-vulkan-debug
ninja -j ${env:NUMBER_OF_PROCESSORS}
- name: Archive library
Expand Down Expand Up @@ -332,7 +333,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. -GNinja -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-23 -DCMAKE_C_FLAGS="-mcpu=generic" -DCMAKE_CXX_FLAGS="-mcpu=generic" -DCMAKE_BUILD_TYPE=Release
cmake .. --preset android-cpu-release
ninja -j $(nproc)
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
Expand Down Expand Up @@ -374,7 +375,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. -GNinja -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-23 -DCMAKE_C_FLAGS="-mcpu=generic" -DCMAKE_CXX_FLAGS="-mcpu=generic" -DCMAKE_BUILD_TYPE=Debug
cmake .. --preset android-cpu-debug
ninja -j $(nproc)
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
Expand Down Expand Up @@ -407,7 +408,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. -DLLAMA_NATIVE=OFF -DLLAMA_METAL=OFF -DCMAKE_BUILD_TYPE=Release
cmake .. --preset macos-cpu-release
cmake --build . --config Release -j $(sysctl -n hw.logicalcpu)
codesign -s - libgodot_llm.darwin.release.universal.dylib
Expand Down Expand Up @@ -439,7 +440,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. -DLLAMA_NATIVE=OFF -DLLAMA_METAL=OFF -DCMAKE_BUILD_TYPE=Debug
cmake .. --preset macos-cpu-debug
cmake --build . --config Debug -j $(sysctl -n hw.logicalcpu)
codesign -s - libgodot_llm.darwin.debug.universal.dylib
Expand Down Expand Up @@ -471,6 +472,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. --preset macos-metal-release
cmake .. -DLLAMA_NATIVE=OFF -DLLAMA_METAL=ON -DLLAMA_METAL_EMBED_LIBRARY=ON -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release -j $(sysctl -n hw.logicalcpu)
codesign -s - libgodot_llm.darwin.release.universal.dylib
Expand Down Expand Up @@ -503,6 +505,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. --preset macos-metal-debug
cmake .. -DLLAMA_NATIVE=OFF -DLLAMA_METAL=ON -DLLAMA_METAL_EMBED_LIBRARY=ON -DCMAKE_BUILD_TYPE=Debug
cmake --build . --config Debug -j $(sysctl -n hw.logicalcpu)
codesign -s - libgodot_llm.darwin.debug.universal.dylib
Expand Down Expand Up @@ -621,4 +624,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: godot_llm_gpu
path: godot_llm_gpu
path: godot_llm_gpu
2 changes: 2 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"LLAMA_NATIVE": "OFF",
"LLAMA_METAL": "ON",
"LLAMA_METAL_EMBED_LIBRARY": "ON",
"CMAKE_BUILD_TYPE": "Debug"
}
},
Expand All @@ -132,6 +133,7 @@
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"LLAMA_NATIVE": "OFF",
"LLAMA_METAL": "ON",
"LLAMA_METAL_EMBED_LIBRARY": "ON",
"CMAKE_BUILD_TYPE": "Release"
}
},
Expand Down

0 comments on commit 84bea08

Please sign in to comment.