Merge pull request #1985 from atipls/dev

Update zig bindings to 0.13.0
This commit is contained in:
lazymio 2024-09-21 18:01:11 +08:00 committed by GitHub
commit 22d6febff1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,7 +1,7 @@
//! License: GNU GENERAL PUBLIC LICENSE Version 2
const std = @import("std");
const MIN_ZIG_VERSION: []const u8 = "0.12.0";
const MIN_ZIG_VERSION: []const u8 = "0.13.0";
const MIN_ZIG_VERSION_ERR_MSG = "Please! Update zig toolchain to >= v" ++ MIN_ZIG_VERSION;
const SampleFileTypes = enum {
@ -125,16 +125,14 @@ fn buildExe(b: *std.Build, info: BuildInfo) *std.Build.Step.Compile {
.name = info.filename(),
.target = info.target,
.optimize = info.optimize,
.root_source_file = .{
.path = info.filepath,
},
.root_source_file = b.path(info.filepath),
},
};
const exe = b.addExecutable(execonfig);
if (info.filetype != .zig) {
exe.addCSourceFile(.{
.file = .{ .path = info.filepath },
.file = b.path(info.filepath),
.flags = &.{
"-Wall",
"-Werror",
@ -144,10 +142,10 @@ fn buildExe(b: *std.Build, info: BuildInfo) *std.Build.Step.Compile {
});
// Ensure the C headers are available
exe.addIncludePath(.{ .path = "include" });
exe.addIncludePath(b.path("include"));
// Ensure the C library is available
exe.addLibraryPath(.{ .path = "build" });
exe.addLibraryPath(b.path("build"));
// linking to OS-LibC or static-linking for:
// Musl(Linux) [e.g: -Dtarget=native-linux-musl]