Skip to content

Commit f9b837e

Browse files
committed
try zig build
1 parent 06fb007 commit f9b837e

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

.github/workflows/build.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
- { os: windows-latest, target: windows, platform: win32-x64}
1313
- { os: windows-latest, target: windows, platform: win32-x86, cmake_arch: "-A Win32"}
1414
- { os: ubuntu-latest, target: linux, platform: linux-x64}
15+
- { os: ubuntu-latest, target: linux, platform: linux-x64-zig, zig_build: true}
1516
- { os: macos-latest, target: darwin, platform: darwin-x64}
1617
- { os: macos-latest, target: darwin, platform: darwin-arm64}
1718
steps:
@@ -42,11 +43,22 @@ jobs:
4243
- name: Build-linux
4344
if: startsWith(matrix.os, 'ubuntu')
4445
run: |
45-
mkdir build
46-
cd build
47-
cmake .. -DCMAKE_BUILD_TYPE=Release -DEMMY_CORE_VERSION=${{env.TAG}}
48-
cmake --build . --config Release
49-
cmake --install . --config Release --prefix ${{ github.workspace }}/artifact/
46+
if [[ "${{ matrix.zig_build }}" == "true" ]]; then
47+
wget https://ziglang.org/builds/zig-linux-x86_64-0.11.0.tar.xz
48+
tar -xf zig-linux-x86_64-0.11.0.tar.xz
49+
export PATH=$PWD/zig-linux-x86_64-0.11.0:$PATH
50+
mkdir build
51+
cd build
52+
CC="zig cc -target x86_64-linux-gnu.2.17" cmake .. -DCMAKE_BUILD_TYPE=Release -DEMMY_CORE_VERSION=${{env.TAG}}
53+
cmake --build . --config Release
54+
cmake --install . --config Release --prefix ${{ github.workspace }}/artifact/
55+
else
56+
mkdir build
57+
cd build
58+
cmake .. -DCMAKE_BUILD_TYPE=Release -DEMMY_CORE_VERSION=${{env.TAG}}
59+
cmake --build . --config Release
60+
cmake --install . --config Release --prefix ${{ github.workspace }}/artifact/
61+
fi
5062
- name: Build-macosx
5163
if: startsWith(matrix.os, 'macos')
5264
run: |

0 commit comments

Comments
 (0)