Compare commits

...

2 Commits

2 changed files with 11 additions and 16 deletions

View File

@@ -1,9 +1,12 @@
const std = @import("std"); const std = @import("std");
const arch = @import("builtin").cpu.arch;
pub fn build(b: *std.Build) void pub fn build(b: *std.Build) void
{ {
const target = b.standardTargetOptions(.{ const target = b.resolveTargetQuery(.{
// .default_target = .{ .abi = .musl }, .cpu_arch = arch,
.os_tag = .linux,
.abi = .musl
}); });
const optimize = b.standardOptimizeOption(.{}); const optimize = b.standardOptimizeOption(.{});
@@ -46,7 +49,6 @@ pub fn build(b: *std.Build) void
}), }),
}); });
// exe.root_module.link_libc = true;
exe.root_module.addOptions("build_options", options); exe.root_module.addOptions("build_options", options);
// //

View File

@@ -46,20 +46,13 @@ pub fn main(init: std.process.Init) !void
var result = try parser.parseProcess(init); var result = try parser.parseProcess(init);
const path = if (debug) path: const tmp_path = result.getString("path") orelse path: {
{ const exe = try std.process.executableDirPathAlloc(io, tmp_allocator);
const tmp_path = result.getString("path") orelse "config/config.toml"; break :path try std.Io.Dir.path.join(tmp_allocator, &.{ exe, "config/config.toml" });
break :path try allocator.dupe(u8, tmp_path);
}
else path:
{
const tmp_path = result.getString("path") orelse blk: {
const exe = try std.process.executableDirPathAlloc(io, tmp_allocator);
break :blk try std.Io.Dir.path.join(tmp_allocator, &.{ exe, "config/config.toml" });
};
break :path try allocator.dupe(u8, tmp_path);
}; };
const path = try allocator.dupe(u8, tmp_path);
_ = zocket.memory.deinitIfExists(&tmp_arena); _ = zocket.memory.deinitIfExists(&tmp_arena);
try run(io, allocator, path); try run(io, allocator, path);