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