update to the latest Zig master

Building with: 0.12.0-dev.1591+3fc6a2f11
This commit is contained in:
Igor Anić 2023-11-12 08:52:48 +01:00
parent ac7f67f0ee
commit 8be486b673
2 changed files with 7 additions and 2 deletions

View File

@ -22,6 +22,11 @@ Add dependency in build.zig.zon:
```
In build.zig link 'z' library and 'zlib' module:
```zig
// Define dependencies
const zlib = b.dependency("zlib", .{});
...
// Link z library and zlib module.
exe.linkLibrary(b.dependency("zlib", .{
.target = target,

View File

@ -16,7 +16,7 @@ pub const Library = struct {
step: *std.build.LibExeObjStep,
pub fn link(self: Library, other: *std.build.LibExeObjStep, opts: Options) void {
other.addIncludePath(include_dir);
other.addIncludePath(.{ .path = include_dir });
other.linkLibrary(self.step);
if (opts.import_name) |import_name|
@ -34,7 +34,7 @@ pub fn create(b: *std.build.Builder, target: std.zig.CrossTarget, optimize: std.
.optimize = optimize,
});
ret.linkLibC();
ret.addCSourceFiles(srcs, &.{"-std=c89"});
ret.addCSourceFiles(.{ .files = srcs, .flags = &.{"-std=c89"} });
return Library{ .step = ret };
}