Update to Zig 0.13.0 (#3)

* Update to zig 0.13.0

* Update readme to zig 0.13.0
This commit is contained in:
Jakub Ostrzołek 2024-08-18 19:49:09 +02:00 committed by GitHub
parent f9b5dffb64
commit 921dd0ace5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 8 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
zig-out/
zig-cache/
.zig-cache/

View File

@ -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");`

View File

@ -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,
});