Skip to content

Commit d099ffd

Browse files
committed
feat: upgrade to zig 0.15.2
1 parent e85cf8b commit d099ffd

3 files changed

Lines changed: 8 additions & 14 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- name: Set up Zig
1212
uses: korandoru/setup-zig@v1
1313
with:
14-
zig-version: 0.14.0
14+
zig-version: 0.15.2
1515

1616
- name: Lint
1717
run: zig fmt --check *.zig
@@ -25,7 +25,7 @@ jobs:
2525
- name: Set up Zig
2626
uses: korandoru/setup-zig@v1
2727
with:
28-
zig-version: 0.14.0
28+
zig-version: 0.15.2
2929

3030
- name: Test
3131
run: zig build test --summary all

build.zig

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,11 @@ pub fn build(b: *Builder) void {
2121
.target = target,
2222
.optimize = optimize,
2323
});
24-
_ = mod;
2524

26-
const lib = b.addStaticLibrary(.{
25+
const lib = b.addLibrary(.{
26+
.linkage = .static,
2727
.name = "snappyz",
28-
// In this case the main source file is merely a path, however, in more
29-
// complicated build scripts, this could be a generated file.
30-
.root_source_file = .{ .cwd_relative = "snappy.zig" },
31-
.optimize = optimize,
32-
.target = target,
28+
.root_module = mod,
3329
});
3430

3531
// This declares intent for the library to be installed into the standard
@@ -40,9 +36,7 @@ pub fn build(b: *Builder) void {
4036
// Creates a step for unit testing. This only builds the test executable
4137
// but does not run it.
4238
const tests = b.addTest(.{
43-
.root_source_file = .{ .cwd_relative = "snappy.zig" },
44-
.optimize = optimize,
45-
.target = target,
39+
.root_module = mod,
4640
});
4741

4842
const run_tests = b.addRunArtifact(tests);

build.zig.zon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// This is a [Semantic Version](https://semver.org/).
1212
// In a future version of Zig it will be used for package deduplication.
13-
.version = "0.0.2",
13+
.version = "0.0.3",
1414

1515
// This field is optional.
1616
// This is currently advisory only; Zig does not yet do anything
@@ -27,7 +27,7 @@
2727
// This field is optional.
2828
// This is currently advisory only; Zig does not yet do anything
2929
// with this value.
30-
.min_zig_version = "0.14.0",
30+
.min_zig_version = "0.15.2",
3131

3232
// Together with name, this represents a globally unique package
3333
// identifier. This field is generated by the Zig toolchain when the

0 commit comments

Comments
 (0)