Skip to content

Commit

Permalink
update for ziglang/zig#18160
Browse files Browse the repository at this point in the history
  • Loading branch information
Phytolizer committed Jan 12, 2024
1 parent 2c78c65 commit 0886163
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 27 deletions.
20 changes: 10 additions & 10 deletions zig/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@ pub fn build(b: *std.Build) void {
const minsk_meta_mod = @import("minsk_meta/build.zig").build(b);
const linenoise = @import("linenoise/build.zig").build(b, target, optimize);

minsk_runtime_mod.dependencies.put("minsk_meta", minsk_meta_mod) catch unreachable;
minsk_runtime_mod.addImport("minsk_meta", minsk_meta_mod);

minsk_mod.dependencies.put("ds_ext", ds_ext_mod) catch unreachable;
minsk_mod.dependencies.put("tty_ext", tty_ext_mod) catch unreachable;
minsk_mod.dependencies.put("minsk_runtime", minsk_runtime_mod) catch unreachable;
minsk_mod.dependencies.put("minsk_meta", minsk_meta_mod) catch unreachable;
minsk_mod.addImport("ds_ext", ds_ext_mod);
minsk_mod.addImport("tty_ext", tty_ext_mod);
minsk_mod.addImport("minsk_runtime", minsk_runtime_mod);
minsk_mod.addImport("minsk_meta", minsk_meta_mod);

const ziglyph_dep = b.dependency("ziglyph", .{
.target = target,
.optimize = optimize,
});
minsk_mod.dependencies.put(
minsk_mod.addImport(
"ziglyph",
ziglyph_dep.module("ziglyph"),
) catch unreachable;
);
const mc_exe = @import("mc/build.zig").build(b, target, optimize);

mc_exe.addModule("minsk", minsk_mod);
mc_exe.addModule("minsk_runtime", minsk_runtime_mod);
mc_exe.addModule("tty_ext", tty_ext_mod);
mc_exe.root_module.addImport("minsk", minsk_mod);
mc_exe.root_module.addImport("minsk_runtime", minsk_runtime_mod);
mc_exe.root_module.addImport("tty_ext", tty_ext_mod);
mc_exe.linkLibrary(linenoise.raw);
mc_exe.step.dependOn(&linenoise.lib.step);
b.installArtifact(mc_exe);
Expand Down
4 changes: 2 additions & 2 deletions zig/build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
.minimum_zig_version = "0.12.0-dev.1836+dd189a354",
.dependencies = .{
.ziglyph = .{
.url = "https://codeberg.org/dude_the_builder/ziglyph/archive/c64c54c6c55545a935c6884a8cdc7d02051633c7.tar.gz",
.hash = "1220a0ffa93af4ba93abafbec043fdfd852fea258423f0534c2ab6d81bdbde532eb8",
.url = "https://codeberg.org/dude_the_builder/ziglyph/archive/0e17bd36a4e882b194a87c283bd78562ea215116.tar.gz",
.hash = "1220e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
},
},
.paths = .{""},
Expand Down
2 changes: 1 addition & 1 deletion zig/ds_ext/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ const std = @import("std");
pub fn build(b: *std.Build) *std.Build.Module {
const this_dir = comptime std.fs.path.dirname(@src().file) orelse ".";
return b.addModule("ds_ext", .{
.source_file = .{ .path = this_dir ++ "/src/main.zig" },
.root_source_file = .{ .path = this_dir ++ "/src/main.zig" },
});
}
6 changes: 3 additions & 3 deletions zig/linenoise/build.zig
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const std = @import("std");

pub fn build(b: *std.Build, target: std.zig.CrossTarget, optimize: std.builtin.Mode) struct {
raw: *std.Build.CompileStep,
lib: *std.Build.InstallArtifactStep,
pub fn build(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.Mode) struct {
raw: *std.Build.Step.Compile,
lib: *std.Build.Step.InstallArtifact,
} {
const this_dir = comptime std.fs.path.dirname(@src().file) orelse ".";
const result = b.addStaticLibrary(.{
Expand Down
2 changes: 1 addition & 1 deletion zig/mc/build.zig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const std = @import("std");

pub fn build(b: *std.Build, target: std.zig.CrossTarget, optimize: std.builtin.Mode) *std.Build.CompileStep {
pub fn build(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.Mode) *std.Build.Step.Compile {
const this_dir = comptime std.fs.path.dirname(@src().file) orelse ".";
return b.addExecutable(.{
.name = "mc",
Expand Down
2 changes: 1 addition & 1 deletion zig/minsk/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ const std = @import("std");
pub fn build(b: *std.Build) *std.Build.Module {
const this_dir = comptime std.fs.path.dirname(@src().file) orelse ".";
return b.addModule("minsk", .{
.source_file = .{ .path = this_dir ++ "/src/main.zig" },
.root_source_file = .{ .path = this_dir ++ "/src/main.zig" },
});
}
2 changes: 1 addition & 1 deletion zig/minsk_meta/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ const std = @import("std");
pub fn build(b: *std.Build) *std.Build.Module {
const this_dir = comptime std.fs.path.dirname(@src().file) orelse ".";
return b.addModule("minsk_meta", .{
.source_file = .{ .path = this_dir ++ "/src/main.zig" },
.root_source_file = .{ .path = this_dir ++ "/src/main.zig" },
});
}
2 changes: 1 addition & 1 deletion zig/minsk_runtime/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ const std = @import("std");
pub fn build(b: *std.Build) *std.Build.Module {
const this_dir = comptime std.fs.path.dirname(@src().file) orelse ".";
return b.addModule("minsk_runtime", .{
.source_file = .{ .path = this_dir ++ "/src/main.zig" },
.root_source_file = .{ .path = this_dir ++ "/src/main.zig" },
});
}
10 changes: 5 additions & 5 deletions zig/minsk_tests/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const std = @import("std");

pub fn build(
b: *std.Build,
target: std.zig.CrossTarget,
target: std.Build.ResolvedTarget,
optimize: std.builtin.Mode,
minsk: *std.Build.Module,
minsk_runtime: *std.Build.Module,
Expand All @@ -14,10 +14,10 @@ pub fn build(
.target = target,
.optimize = optimize,
});
exe.addModule("minsk", minsk);
exe.addModule("minsk_runtime", minsk_runtime);
exe.addAnonymousModule("framework", .{
.source_file = .{ .path = this_dir ++ "/framework.zig" },
exe.root_module.addImport("minsk", minsk);
exe.root_module.addImport("minsk_runtime", minsk_runtime);
exe.root_module.addAnonymousImport("framework", .{
.root_source_file = .{ .path = this_dir ++ "/framework.zig" },
});
_ = b.addInstallArtifact(exe, .{});

Expand Down
2 changes: 1 addition & 1 deletion zig/minsk_tests/src/code_analysis/syntax/AnnotatedText.zig
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub fn unindentLines(comptime text: []const u8) []const []const u8 {
pos = eol + 1;
}

comptime var min_indentation = std.math.maxInt(usize);
var min_indentation = std.math.maxInt(usize);
for (lines) |line| {
if (std.mem.trim(u8, line, " ").len == 0) {
line.* = "";
Expand Down
2 changes: 1 addition & 1 deletion zig/tty_ext/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ const std = @import("std");
pub fn build(b: *std.Build) *std.Build.Module {
const this_dir = comptime std.fs.path.dirname(@src().file) orelse ".";
return b.addModule("tty_ext", .{
.source_file = .{ .path = this_dir ++ "/src/main.zig" },
.root_source_file = .{ .path = this_dir ++ "/src/main.zig" },
});
}

0 comments on commit 0886163

Please sign in to comment.