Skip to content

Commit

Permalink
fix: adopt with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
jiacai2050 committed Jan 7, 2024
1 parent d5db773 commit 8665bea
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ const Source = union(enum) {

fn addModules(
b: *std.Build,
target: std.zig.CrossTarget,
target: std.Build.ResolvedTarget,
all_tests: *std.ArrayList(*Build.Step),
) !void {
inline for (.{ "pretty-table", "simargs" }) |name| {
_ = b.addModule(name, .{
.source_file = .{ .path = "src/mod/" ++ name ++ ".zig" },
.root_source_file = .{ .path = "src/mod/" ++ name ++ ".zig" },
});

try all_tests.append(buildTestStep(b, .{ .mod = name }, target));
Expand All @@ -79,7 +79,7 @@ fn addModules(
fn buildExamples(
b: *std.Build,
optimize: std.builtin.Mode,
target: std.zig.CrossTarget,
target: std.Build.ResolvedTarget,
all_tests: *std.ArrayList(*Build.Step),
) !void {
inline for (.{
Expand All @@ -93,7 +93,7 @@ fn buildExamples(
fn buildBinaries(
b: *std.Build,
optimize: std.builtin.Mode,
target: std.zig.CrossTarget,
target: std.Build.ResolvedTarget,
all_tests: *std.ArrayList(*Build.Step),
) !void {
const is_ci = b.option(bool, "is_ci", "Build in CI") orelse false;
Expand All @@ -118,14 +118,14 @@ fn buildBinary(
b: *std.Build,
comptime source: Source,
optimize: std.builtin.Mode,
target: std.zig.CrossTarget,
target: std.Build.ResolvedTarget,
is_ci: bool,
all_tests: *std.ArrayList(*Build.Step),
) !void {
if (makeCompileStep(b, source, optimize, target, is_ci)) |exe| {
var deps = b.modules.iterator();
while (deps.next()) |dep| {
exe.addModule(dep.key_ptr.*, dep.value_ptr.*);
exe.root_module.addImport(dep.key_ptr.*, dep.value_ptr.*);
}

b.installArtifact(exe);
Expand All @@ -146,7 +146,7 @@ fn buildBinary(
fn buildTestStep(
b: *std.Build,
comptime source: Source,
target: std.zig.CrossTarget,
target: std.Build.ResolvedTarget,
) *Build.Step {
const name = comptime source.name();
const path = comptime source.path();
Expand All @@ -164,9 +164,9 @@ fn makeCompileStep(
b: *std.Build,
comptime source: Source,
optimize: std.builtin.Mode,
target: std.zig.CrossTarget,
target: std.Build.ResolvedTarget,
is_ci: bool,
) ?*Build.CompileStep {
) ?*Build.Step.Compile {
const name = comptime source.name();
const path = comptime source.path();
if (std.mem.eql(u8, name, "night-shift") or std.mem.eql(u8, name, "dark-mode") or std.mem.eql(u8, name, "pidof")) {
Expand Down

0 comments on commit 8665bea

Please sign in to comment.