Skip to content

Commit

Permalink
Merge pull request #12 from usdogu/fix-build
Browse files Browse the repository at this point in the history
fix: build
  • Loading branch information
nilslice authored Jan 5, 2024
2 parents 55e640a + c035e20 commit a457e65
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ This package works with the Zig package manager introduced in Zig 0.11. Create a
And in your `build.zig`:
```zig
const extism_module = b.dependency("extism", .{ .target = target, .optimize = optimize }).module("extism");
exe.addModule("extism", extism_module);
exe.root_module.addImport("extism", extism_module);
// TODO: make this easier to install
// add the shared library & header
exe.linkLibC();
Expand Down
8 changes: 4 additions & 4 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const builtin = @import("builtin");
pub fn build(b: *std.Build) void {
comptime {
const current_zig = builtin.zig_version;
const min_zig = std.SemanticVersion.parse("0.12.0-dev.64+b835fd90c") catch unreachable; // std.json.ArrayHashMap
const min_zig = std.SemanticVersion.parse("0.12.0-dev.2030") catch unreachable; // build system changes: ziglang/zig#18160
if (current_zig.order(min_zig) == .lt) {
@compileError(std.fmt.comptimePrint("Your Zig version v{} does not meet the minimum build requirement of v{}", .{ current_zig, min_zig }));
}
Expand All @@ -14,7 +14,7 @@ pub fn build(b: *std.Build) void {
const optimize = b.standardOptimizeOption(.{});

const extism_module = b.addModule("extism", .{
.source_file = .{ .path = "src/main.zig" },
.root_source_file = .{ .path = "src/main.zig" },
});

var tests = b.addTest(.{
Expand All @@ -24,7 +24,7 @@ pub fn build(b: *std.Build) void {
.optimize = optimize,
});

tests.addModule("extism", extism_module);
tests.root_module.addImport("extism", extism_module);
tests.linkLibC();
tests.addIncludePath(.{ .path = "/usr/local/include" });
tests.addLibraryPath(.{ .path = "/usr/local/lib" });
Expand All @@ -41,7 +41,7 @@ pub fn build(b: *std.Build) void {
.optimize = optimize,
});

example.addModule("extism", extism_module);
example.root_module.addImport("extism", extism_module);
example.linkLibC();
example.addIncludePath(.{ .path = "/usr/local/include" });
example.addLibraryPath(.{ .path = "/usr/local/lib" });
Expand Down
2 changes: 1 addition & 1 deletion build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.{
.name = "extism",
.version = "1.0.0-rc1",
.version = "1.0.0-rc2",
.paths = .{""},
}

0 comments on commit a457e65

Please sign in to comment.