update to the latest Zig master
Building with: 0.12.0-dev.1591+3fc6a2f11
This commit is contained in:
parent
ac7f67f0ee
commit
8be486b673
@ -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,
|
||||
|
4
zlib.zig
4
zlib.zig
@ -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 };
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user