diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2026-04-19 18:55:36 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2026-04-19 18:55:36 +0200 |
| commit | c46957f44e8b5ba0639b7092a1c5abd9516b1b22 (patch) | |
| tree | fdd20da760740866060a139958e2f84a0e7fc81b /build.zig | |
| parent | cf6f08d1602841f8c337dc64365e2dcde1e4c528 (diff) | |
fix(ast): small memory leak in subs
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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); } |
