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:
parent
f9b5dffb64
commit
921dd0ace5
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,2 @@
|
||||
zig-out/
|
||||
zig-cache/
|
||||
.zig-cache/
|
||||
|
@ -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");`
|
10
build.zig
10
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,
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user