Compare commits
4 Commits
5b1a987a5b
...
4e9fddc593
| Author | SHA1 | Date | |
|---|---|---|---|
|
4e9fddc593
|
|||
|
b43361da73
|
|||
|
4714ec2bf9
|
|||
|
a209fd6df5
|
@@ -15,7 +15,7 @@ jobs:
|
|||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Setup zig installation
|
- name: Setup zig installation
|
||||||
uses: mlugg/setup-zig@v1
|
uses: mlugg/setup-zig@v2
|
||||||
with:
|
with:
|
||||||
version: master
|
version: master
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
|
|||||||
36
build.zig
36
build.zig
@@ -35,21 +35,27 @@ pub fn build(b: *std.Build) void {
|
|||||||
const zlog_module = b.addModule("zlog", .{
|
const zlog_module = b.addModule("zlog", .{
|
||||||
// In this case the main source file is merely a path, however, in more
|
// In this case the main source file is merely a path, however, in more
|
||||||
// complicated build scripts, this could be a generated file.
|
// complicated build scripts, this could be a generated file.
|
||||||
.root_source_file = b.path("src/zlog.zig"),
|
.root_source_file = b.path("src/root.zig"),
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.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(.{
|
const exe = b.addExecutable(.{
|
||||||
.name = "zlog",
|
.name = "zlog",
|
||||||
.root_source_file = b.path("src/main.zig"),
|
.root_module = b.createModule(.{
|
||||||
.target = target,
|
.root_source_file = b.path("src/main.zig"),
|
||||||
.optimize = optimize,
|
.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
|
// This declares intent for the executable to be installed into the
|
||||||
// standard location when the user invokes the "install" step (the default
|
// 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
|
// Creates a step for unit testing. This only builds the test executable
|
||||||
// but does not run it.
|
// but does not run it.
|
||||||
const lib_unit_tests = b.addTest(.{
|
const lib_unit_tests = b.addTest(.{
|
||||||
.root_source_file = b.path("src/zlog.zig"),
|
.root_module = b.createModule(.{
|
||||||
.target = target,
|
.root_source_file = b.path("src/root.zig"),
|
||||||
.optimize = optimize,
|
.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);
|
const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests);
|
||||||
|
|
||||||
|
|||||||
@@ -3,14 +3,14 @@
|
|||||||
.fingerprint = 0x55b82e3347a594e8,
|
.fingerprint = 0x55b82e3347a594e8,
|
||||||
// version name should match the zig version except for the last number,
|
// version name should match the zig version except for the last number,
|
||||||
// which stands for the version inside a given zig version
|
// which stands for the version inside a given zig version
|
||||||
.version = "0.13.0",
|
.version = "0.15.0",
|
||||||
.dependencies = .{
|
.dependencies = .{
|
||||||
.ztime = .{
|
.ztime = .{
|
||||||
.url = "git+https://gitea.yves-biener.de/yves-biener/ztime#eacf7abf059646d12d704d01ee8c9c6bf4dc219a",
|
.url = "git+https://gitea.yves-biener.de/yves-biener/ztime#6a2f853f36aa55146e089d7c0c3f041012c0f8fe",
|
||||||
.hash = "ztime-0.0.0-e3nBJE1wAADaGX5lHpHg1U4-kD6rI5Erb6gjM3-w3DsN",
|
.hash = "ztime-0.0.0-e3nBJL5xAAC_guuqgVnOZncpvwH76NnKRC7JJ_zTF9rV",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
.minimum_zig_version = "0.14.0",
|
.minimum_zig_version = "0.15.0",
|
||||||
.paths = .{
|
.paths = .{
|
||||||
"build.zig",
|
"build.zig",
|
||||||
"build.zig.zon",
|
"build.zig.zon",
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ fn logFn(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (comptime build_options.stderr) {
|
if (comptime build_options.stderr) {
|
||||||
var buffer = io.bufferedWriter(io.getStdErr().writer());
|
var buffer = io.bufferedWriter(stderr().deprecatedWriter());
|
||||||
defer buffer.flush() catch {};
|
defer buffer.flush() catch {};
|
||||||
|
|
||||||
std.debug.lockStdErr();
|
std.debug.lockStdErr();
|
||||||
@@ -193,6 +193,8 @@ pub const std_options: std.Options = .{
|
|||||||
|
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const io = std.io;
|
const io = std.io;
|
||||||
|
const fs = std.fs;
|
||||||
|
const stderr = fs.File.stderr;
|
||||||
const log = std.log;
|
const log = std.log;
|
||||||
const fmt = std.fmt;
|
const fmt = std.fmt;
|
||||||
const build_options = @import("build_options");
|
const build_options = @import("build_options");
|
||||||
Reference in New Issue
Block a user