Skip to content

Commit

Permalink
feat: add extism build script util
Browse files Browse the repository at this point in the history
  • Loading branch information
nilslice committed Mar 12, 2024
1 parent 4a6a921 commit 00f962e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,12 @@ pub fn build(b: *std.Build) void {
const example_step = b.step("run_example", "Run the basic example");
example_step.dependOn(&example_run_step.step);
}

pub fn addLibrary(to: *std.Build.Step.Compile, b: *std.Build) void {
to.root_module.addImport("extism", b.dependency("extism", .{}).module("extism"));
to.linkLibC();
// TODO: switch based on platform and use platform-specific paths here
to.addIncludePath(.{ .path = "/usr/local/include" });
to.addLibraryPath(.{ .path = "/usr/local/lib" });
to.linkSystemLibrary("extism");
}

0 comments on commit 00f962e

Please sign in to comment.