diff --git a/.gitignore b/.gitignore index 8bc911a..dca1103 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ zig-out/ -zig-cache/ \ No newline at end of file +.zig-cache/ diff --git a/README.md b/README.md index 2392591..8c8c6e6 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ const gpio = b.dependency("gpio", .{ .target = target, .optimize = optimize, }); -exe.addModule("gpio", gpio.module("gpio")); +exe.root_module.addImport("gpio", gpio.module("gpio")); ``` -And that's it! You should now be able to use `zig-gpio` via `@import("gpio");` \ No newline at end of file +And that's it! You should now be able to use `zig-gpio` via `@import("gpio");` diff --git a/build.zig b/build.zig index 9f57029..4d10600 100644 --- a/build.zig +++ b/build.zig @@ -7,8 +7,8 @@ const Item = struct { /// List of examples const examples = [_]Item{ - .{ .name = "blinky", .src = "src/examples/blinky.zig" }, - .{ .name = "multi", .src = "src/examples/multi.zig" }, + .{ .name = "blinky", .src = "examples/blinky.zig" }, + .{ .name = "multi", .src = "examples/multi.zig" }, }; /// List of commands @@ -24,7 +24,7 @@ pub fn build(b: *std.Build) !void { const optimize = b.standardOptimizeOption(.{}); // Add the gpio module so it can be used by the package manager - const gpio_module = b.createModule(.{ .root_source_file = .{ .path = "src/index.zig" } }); + const gpio_module = b.createModule(.{ .root_source_file = b.path("src/index.zig") }); try b.modules.put(b.dupe("gpio"), gpio_module); // Create a step to build all the examples @@ -37,7 +37,7 @@ pub fn build(b: *std.Build) !void { const exe = b.addExecutable(.{ .name = cfg.name, - .root_source_file = .{ .path = cfg.src }, + .root_source_file = b.path(cfg.src), .target = target, .optimize = optimize, }); @@ -58,7 +58,7 @@ pub fn build(b: *std.Build) !void { const exe = b.addExecutable(.{ .name = cfg.name, - .root_source_file = .{ .path = cfg.src }, + .root_source_file = b.path(cfg.src), .target = target, .optimize = optimize, });