-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.zig
More file actions
29 lines (25 loc) · 933 Bytes
/
build.zig
File metadata and controls
29 lines (25 loc) · 933 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const std = @import("std");
const ziex = @import("ziex");
pub fn build(b: *std.Build) !void {
// --- Target and Optimize from `zig build` arguments ---
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
// --- Ziex App Executable ---
const app_exe = b.addExecutable(.{
.name = "ziex_app",
.root_module = b.createModule(.{
.root_source_file = b.path("app/main.zig"),
.target = target,
.optimize = optimize,
}),
});
const c = b.addTranslateC(.{
.root_source_file = b.path("./app/root.c"),
.target = target,
.optimize = optimize,
.link_libc = false,
});
app_exe.root_module.addImport("c", c.createModule());
// --- Ziex setup: wires dependencies and adds `zx`/`dev` build steps ---
_ = try ziex.init(b, app_exe, .{ .cli = .{ .optimize = optimize } });
}