Skip to content

Commit d9346a2

Browse files
committed
add zig package manager support
1 parent cdc46cd commit d9346a2

File tree

5 files changed

+36
-8
lines changed

5 files changed

+36
-8
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ jobs:
1717
- uses: goto-bus-stop/setup-zig@v2
1818
with:
1919
version: 0.12.0
20-
- run: zig test stable_array.zig
20+
- run: zig build test

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Typical usage is to specify a large size up-front that the array should not enco
77

88
Usage:
99
```zig
10-
var array = StableArray(u8).init(TEST_VIRTUAL_ALLOC_SIZE);
10+
var array = StableArray(u8).init(1024 * 1024 * 1024 * 128); // virtual address reservation of 128 GB
1111
try array.appendSlice(&[_]u8{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 });
1212
assert(array.calcTotalUsedBytes() == mem.page_size);
1313
for (array.items) |v, i| {

build.zig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const std = @import("std");
2+
3+
pub fn build(b: *std.Build) void {
4+
const target = b.standardTargetOptions(.{});
5+
const optimize = b.standardOptimizeOption(.{});
6+
7+
_ = b.addStaticLibrary(.{
8+
.name = "zig-stable-array",
9+
.root_source_file = b.path("stable_array.zig"),
10+
.target = target,
11+
.optimize = optimize,
12+
});
13+
14+
const lib_unit_tests = b.addTest(.{
15+
.root_source_file = b.path("stable_array.zig"),
16+
.target = target,
17+
.optimize = optimize,
18+
});
19+
const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests);
20+
const test_step = b.step("test", "Run unit tests");
21+
test_step.dependOn(&run_lib_unit_tests.step);
22+
}

build.zig.zon

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.{
2+
.name = "zig-stable-array",
3+
.version = "0.1.0",
4+
.dependencies = .{},
5+
.paths = .{
6+
"build.zig",
7+
"build.zig.zon",
8+
"stable_array.zig",
9+
"LICENSE",
10+
"README.md",
11+
}
12+
}

zigmod.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)