Compare commits
2 Commits
7c97ad554e
...
7ae1907189
| Author | SHA1 | Date | |
|---|---|---|---|
| 7ae1907189 | |||
| 2a6ade9bf7 |
10
build.zig
10
build.zig
@@ -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);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
17
src/main.zig
17
src/main.zig
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user