-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from kassane/rework
Update to Zig 0.11
- Loading branch information
Showing
10 changed files
with
203 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: MSYS2 (MingW) | ||
|
||
on: | ||
push: | ||
paths: | ||
- '**.zig' | ||
schedule: | ||
- cron: '0 0 * * *' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: [ | ||
{ msystem: CLANG64, arch: x86_64, prefix: /clang64 }, | ||
{ msystem: CLANG32, arch: i686, prefix: /clang32 } | ||
] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
path: temp | ||
submodules: recursive | ||
fetch-depth: 0 | ||
- uses: goto-bus-stop/setup-zig@v2 | ||
with: | ||
version: master | ||
- uses: msys2/setup-msys2@v2 | ||
with: | ||
msystem: ${{ matrix.msystem }} | ||
path-type: inherit | ||
location: D:\ | ||
install: git mingw-w64-clang-${{ matrix.arch }}-vlc | ||
update: true | ||
|
||
# - name: install windows sdk | ||
# run: choco install windows-sdk-10.0 | ||
|
||
- name: Move Checkout | ||
run: | | ||
Copy-Item -Path ".\temp" -Destination "C:\_" -Recurse | ||
- name: Build & Tests (x86) | ||
shell: msys2 {0} | ||
if: ${{ matrix.arch == 'i686' }} | ||
run: | | ||
cd /C/_ | ||
zig build -fsummary -freference-trace -Doptimize=ReleaseSafe -Dtarget=x86-windows-gnu | ||
zig build run -Doptimize=ReleaseSafe -Dtarget=x86-windows-gnu | ||
- name: Build & Tests (x86_x64) | ||
shell: msys2 {0} | ||
if: ${{ matrix.arch == 'x86_64' }} | ||
run: | | ||
cd /C/_ | ||
zig build -fsummary -freference-trace -Doptimize=ReleaseSafe -Dtarget=native-windows-gnu | ||
zig build run -Doptimize=ReleaseSafe -Dtarget=native-windows-gnu |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.{ | ||
.name = "libvlc", | ||
.version = "0.1.0", | ||
.dependencies = .{ | ||
.libsdl = .{ | ||
.url = "https://github.com/andrewrk/sdl/archive/73c38318443a98b80d7cd0cd1e18a190a85e842f.tar.gz", | ||
.hash = "12202047e83332d37477811513bd6446c567efa6f03c4ae5e57585412b4ad8129cae", | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const std = @import("std"); | ||
const builtin = @import("builtin"); | ||
const math = std.math; | ||
const system = std.os.system; | ||
const timespec = system.timespec; | ||
const errno = system.getErrno; | ||
|
||
const size = switch (builtin.os.tag) { | ||
.windows => c_long, | ||
else => isize, | ||
}; | ||
|
||
pub export fn nanosleep(seconds: u64, nanoseconds: u64) void { | ||
var req = timespec{ | ||
.tv_sec = math.cast(isize, seconds) orelse math.maxInt(isize), | ||
.tv_nsec = math.cast(size, nanoseconds) orelse math.maxInt(size), | ||
}; | ||
var rem: timespec = undefined; | ||
while (true) { | ||
switch (errno(system.nanosleep(&req, &rem))) { | ||
.FAULT => unreachable, | ||
.INVAL => { | ||
// Sometimes Darwin returns EINVAL for no reason. | ||
// We treat it as a spurious wakeup. | ||
return; | ||
}, | ||
.INTR => { | ||
req = rem; | ||
continue; | ||
}, | ||
// This prong handles success as well as unexpected errors. | ||
else => return, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule SDL2-zig
deleted from
2fbd4b