chor: update zig version
This commit is contained in:
34
build.zig
34
build.zig
@@ -38,18 +38,24 @@ pub fn build(b: *std.Build) void {
|
||||
.root_source_file = b.path("src/zlog.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
.imports = &.{
|
||||
.{ .name = "ztime", .module = ztime_dependency.module("ztime") },
|
||||
.{ .name = "build_options", .module = options_module },
|
||||
},
|
||||
});
|
||||
zlog_module.addImport("ztime", ztime_dependency.module("ztime"));
|
||||
zlog_module.addImport("build_options", options_module);
|
||||
|
||||
const exe = b.addExecutable(.{
|
||||
.name = "zlog",
|
||||
.root_source_file = b.path("src/main.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
.root_module = b.createModule(.{
|
||||
.root_source_file = b.path("src/main.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
.imports = &.{
|
||||
.{ .name = "ztime", .module = ztime_dependency.module("ztime") },
|
||||
.{ .name = "zlog", .module = zlog_module },
|
||||
},
|
||||
}),
|
||||
});
|
||||
exe.root_module.addImport("ztime", ztime_dependency.module("ztime"));
|
||||
exe.root_module.addImport("zlog", zlog_module);
|
||||
|
||||
// This declares intent for the executable to be installed into the
|
||||
// standard location when the user invokes the "install" step (the default
|
||||
@@ -82,12 +88,16 @@ pub fn build(b: *std.Build) void {
|
||||
// Creates a step for unit testing. This only builds the test executable
|
||||
// but does not run it.
|
||||
const lib_unit_tests = b.addTest(.{
|
||||
.root_source_file = b.path("src/zlog.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
.root_module = b.createModule(.{
|
||||
.root_source_file = b.path("src/zlog.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
.imports = &.{
|
||||
.{ .name = "ztime", .module = ztime_dependency.module("ztime") },
|
||||
.{ .name = "build_options", .module = options_module },
|
||||
},
|
||||
}),
|
||||
});
|
||||
lib_unit_tests.root_module.addImport("ztime", ztime_dependency.module("ztime"));
|
||||
lib_unit_tests.root_module.addImport("build_options", options_module);
|
||||
|
||||
const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests);
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ fn logFn(
|
||||
}
|
||||
|
||||
if (comptime build_options.stderr) {
|
||||
var buffer = io.bufferedWriter(io.getStdErr().writer());
|
||||
var buffer = io.bufferedWriter(stderr().deprecatedWriter());
|
||||
defer buffer.flush() catch {};
|
||||
|
||||
std.debug.lockStdErr();
|
||||
@@ -193,6 +193,8 @@ pub const std_options: std.Options = .{
|
||||
|
||||
const std = @import("std");
|
||||
const io = std.io;
|
||||
const fs = std.fs;
|
||||
const stderr = fs.File.stderr;
|
||||
const log = std.log;
|
||||
const fmt = std.fmt;
|
||||
const build_options = @import("build_options");
|
||||
|
||||
Reference in New Issue
Block a user