aboutsummaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2026-04-19 18:55:36 +0200
committerAnhgelus Morhtuuzh <william@herges.fr>2026-04-19 18:55:36 +0200
commitc46957f44e8b5ba0639b7092a1c5abd9516b1b22 (patch)
treefdd20da760740866060a139958e2f84a0e7fc81b /build.zig
parentcf6f08d1602841f8c337dc64365e2dcde1e4c528 (diff)
fix(ast): small memory leak in subs
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig6
1 files changed, 4 insertions, 2 deletions
diff --git a/build.zig b/build.zig
index 57e8ff1..d00aedd 100644
--- a/build.zig
+++ b/build.zig
@@ -15,7 +15,9 @@ pub fn build(b: *std.Build) void {
.linkage = .dynamic,
.root_module = mod,
});
- b.installArtifact(lib);
+ const installed_lib = b.addInstallArtifact(lib, .{});
+ // when emitting headers will be fixed
+ //installed_lib.emitted_h = lib.getEmittedH();
const example = b.addExecutable(.{
.name = "example",
@@ -29,7 +31,6 @@ pub fn build(b: *std.Build) void {
.file = b.path("examples/main.c"),
});
example.root_module.linkLibrary(lib);
- // manually writing headers because lib.getEmittedH() doesn't work.
example.root_module.addIncludePath(b.path("include"));
const mod_tests = b.addTest(.{
@@ -41,6 +42,7 @@ pub fn build(b: *std.Build) void {
test_step.dependOn(&run_mod_tests.step);
const examples_step = b.step("examples", "Run examples");
+ examples_step.dependOn(&installed_lib.step);
const example_run = b.addRunArtifact(example);
examples_step.dependOn(&example_run.step);
}