Skip to content

Commit 52f2ce4

Browse files
committed
Update to Zig 0.15.1
1 parent 852c59b commit 52f2ce4

File tree

6 files changed

+187
-143
lines changed

6 files changed

+187
-143
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ Resoures can be anything, such as scripts, images, text, templates config files
1919
* An image in your own format that's able to display itself when executed
2020

2121
## Building the project
22-
To build with Zig 0.13, use the `zig-<version>` tag/release.
23-
To build with Zig 0.14 or master, use the main branch (last tested with Zig version `0.15.0-dev.11+5c57e90ff`)
22+
To build with a specific Zig version, use the `zig-<version>` tag.
23+
To build with Zig master, use the main branch.
2424

2525
`zig build` will put a `bin` and `lib` directory in your output folder (e.g. zig-out)
2626

@@ -47,6 +47,7 @@ stitch ./mylisp std=std.lisp fibonacci=fib.lisp --output fib
4747
If a name is not given, the filename (without path) is used. The stitch library supports finding resources by name or index.
4848

4949
The `--output` flag is optional. By default, resources are added to the original executable (first argument)
50+
5051
## Stitching programmatically
5152
Let's say you want your interpreted programming language to support producing binaries.
5253

build.zig

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,23 @@ pub fn build(b: *std.Build) void {
99
.root_source_file = b.path("src/lib.zig"),
1010
});
1111

12-
const lib = b.addStaticLibrary(.{
12+
const lib = b.addLibrary(.{
1313
.name = "stitch",
14-
.root_source_file = b.path("src/lib.zig"),
15-
.target = target,
16-
.optimize = optimize,
14+
.root_module = b.createModule(.{
15+
.root_source_file = b.path("src/lib.zig"),
16+
.target = target,
17+
.optimize = optimize,
18+
}),
1719
});
1820
b.installArtifact(lib);
1921

2022
const exe = b.addExecutable(.{
2123
.name = "stitch",
22-
.root_source_file = b.path("src/main.zig"),
23-
.target = target,
24-
.optimize = optimize,
24+
.root_module = b.createModule(.{
25+
.root_source_file = b.path("src/main.zig"),
26+
.target = target,
27+
.optimize = optimize,
28+
}),
2529
});
2630
exe.root_module.addImport("stitch", stitch_mod);
2731
b.installArtifact(exe);
@@ -37,9 +41,11 @@ pub fn build(b: *std.Build) void {
3741
// Creates a step for unit testing.
3842
const main_tests = b.addTest(.{
3943
.name = "tests",
40-
.root_source_file = b.path("src/tests.zig"),
41-
.target = target,
42-
.optimize = optimize,
44+
.root_module = b.createModule(.{
45+
.root_source_file = b.path("src/tests.zig"),
46+
.target = target,
47+
.optimize = optimize,
48+
}),
4349
});
4450
main_tests.root_module.addImport("stitch", stitch_mod);
4551

build.zig.zon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.{
22
.name = .stitch,
3-
.version = "0.1.0",
3+
.version = "1.0.0",
44
.paths = .{
55
"build.zig",
66
"build.zig.zon",

0 commit comments

Comments
 (0)