Skip to content

Commit

Permalink
Add Windows Zig example programs build
Browse files Browse the repository at this point in the history
  • Loading branch information
fwsGonzo committed Dec 12, 2024
1 parent bcfa1bc commit 251e4e2
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/zig-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Zig C++ Windows AMD64
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
BUILD_TYPE: Release

jobs:
build:
runs-on: windows-latest
env:
CC: zig cc -target riscv64-linux-musl
CXX: zig c++ -target riscv64-linux-musl

steps:
- uses: actions/checkout@v2

- name: Install dependencies
run: |
choco install ninja
git submodule update --init --recursive --depth=1
# Install Zig
curl -L https://ziglang.org/builds/zig-windows-x86_64-0.14.0-dev.2441+3670910f2.zip -o zig.zip
7z.exe x -y zig.zip
shell: bash

- name: Build all examples
working-directory: ${{github.workspace}}
run: |
export PATH=$PWD/zig-windows-x86_64-0.14.0-dev.2441+3670910f2:$PATH
cmake -G Ninja -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSTRIPPED=ON -DCMAKE_TOOLCHAIN_FILE=cmake/zig-toolchain.cmake
cmake --build build --parallel 8
shell: bash
4 changes: 4 additions & 0 deletions programs/asm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ project(asmjit)

option(ZLIB_BUILD_EXAMPLES "" OFF)


include(FetchContent)
FetchContent_Declare(
zlib
Expand All @@ -11,6 +12,9 @@ FetchContent_Declare(
)
FetchContent_MakeAvailable(zlib)

# Disable shared zlib from ALL
set_target_properties(zlib PROPERTIES EXCLUDE_FROM_ALL TRUE)

# Add the RISC-V asmjit static library
add_library(riscv_asmjit STATIC IMPORTED)
if (ZIG_COMPILER)
Expand Down

0 comments on commit 251e4e2

Please sign in to comment.