joadnacer / jdz_allocator

Zig General Purpose Memory Allocator
MIT License
29 stars 1 forks source link

How do I install this package as of 0.12.0 ? #3

Closed zenshixd closed 1 month ago

zenshixd commented 1 month ago

As per README, there is a: exe.addModule("jdz_allocator", jdz_allocator.module("jdz_allocator"));

but in released 0.12.0, exe.addModule() function no longer exists, and I cant find whats the replacement. Have you tried installing it since 0.12.0 ?

zenshixd commented 1 month ago

Aaaaaaaand soon after making this issue I finally found it:

    const jdz_dep = b.dependency("jdz_allocator", .{
        .target = target,
        .optimize = optimize,
    });

    const exe = b.addExecutable(.{
        .name = "zapts",
        .root_source_file = .{ .path = "src/main.zig" },
        .target = target,
        .optimize = optimize,
    });
    exe.root_module.addImport("jdz_allocator", jdz_dep.module("jdz_allocator"));
    b.installArtifact(exe);
joadnacer commented 1 month ago

Thanks for raising the issue, have now updated the README.