|
11 | 11 | include: |
12 | 12 | - { os: windows-latest, target: windows, platform: win32-x64} |
13 | 13 | - { os: windows-latest, target: windows, platform: win32-x86, cmake_arch: "-A Win32"} |
14 | | - - { os: ubuntu-latest, target: linux, platform: linux-x64} |
| 14 | + - { os: ubuntu-latest, target: linux, platform: linux-x64, zig_build: true} |
15 | 15 | - { os: macos-latest, target: darwin, platform: darwin-x64} |
16 | 16 | - { os: macos-latest, target: darwin, platform: darwin-arm64} |
17 | 17 | steps: |
@@ -42,11 +42,20 @@ jobs: |
42 | 42 | - name: Build-linux |
43 | 43 | if: startsWith(matrix.os, 'ubuntu') |
44 | 44 | 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/ |
| 45 | + if [[ "${{ matrix.zig_build }}" == "true" ]]; then |
| 46 | + sudo snap install zig --classic --beta |
| 47 | + mkdir -p build |
| 48 | + # 使用Zig作为工具链编译C++项目 |
| 49 | + cmake -B build -G Ninja -DCMAKE_C_COMPILER=zig -DCMAKE_C_COMPILER_ARG1=cc -DCMAKE_CXX_COMPILER=zig -DCMAKE_CXX_COMPILER_ARG1=c++ -DCMAKE_BUILD_TYPE=Release -DEMMY_CORE_VERSION=${{env.TAG}} |
| 50 | + cmake --build build --config Release |
| 51 | + cmake --install build --config Release --prefix ${{ github.workspace }}/artifact/ |
| 52 | + else |
| 53 | + mkdir build |
| 54 | + cd build |
| 55 | + cmake .. -DCMAKE_BUILD_TYPE=Release -DEMMY_CORE_VERSION=${{env.TAG}} |
| 56 | + cmake --build . --config Release |
| 57 | + cmake --install . --config Release --prefix ${{ github.workspace }}/artifact/ |
| 58 | + fi |
50 | 59 | - name: Build-macosx |
51 | 60 | if: startsWith(matrix.os, 'macos') |
52 | 61 | run: | |
|
0 commit comments