Compare commits
2 Commits
7c97ad554e
...
7ae1907189
| Author | SHA1 | Date | |
|---|---|---|---|
| 7ae1907189 | |||
| 2a6ade9bf7 |
@@ -1,9 +1,12 @@
|
||||
const std = @import("std");
|
||||
const arch = @import("builtin").cpu.arch;
|
||||
|
||||
pub fn build(b: *std.Build) void
|
||||
{
|
||||
const target = b.standardTargetOptions(.{
|
||||
// .default_target = .{ .abi = .musl },
|
||||
const target = b.resolveTargetQuery(.{
|
||||
.cpu_arch = arch,
|
||||
.os_tag = .linux,
|
||||
.abi = .musl
|
||||
});
|
||||
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);
|
||||
|
||||
//
|
||||
|
||||
15
src/main.zig
15
src/main.zig
@@ -46,20 +46,13 @@ pub fn main(init: std.process.Init) !void
|
||||
|
||||
var result = try parser.parseProcess(init);
|
||||
|
||||
const path = if (debug) path:
|
||||
{
|
||||
const tmp_path = result.getString("path") orelse "config/config.toml";
|
||||
break :path try allocator.dupe(u8, tmp_path);
|
||||
}
|
||||
else path:
|
||||
{
|
||||
const tmp_path = result.getString("path") orelse blk: {
|
||||
const tmp_path = result.getString("path") orelse path: {
|
||||
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);
|
||||
break :path try std.Io.Dir.path.join(tmp_allocator, &.{ exe, "config/config.toml" });
|
||||
};
|
||||
|
||||
const path = try allocator.dupe(u8, tmp_path);
|
||||
|
||||
_ = zocket.memory.deinitIfExists(&tmp_arena);
|
||||
|
||||
try run(io, allocator, path);
|
||||
|
||||
Reference in New Issue
Block a user