-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.zig
More file actions
24 lines (19 loc) · 771 Bytes
/
build.zig
File metadata and controls
24 lines (19 loc) · 771 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
const Builder = @import("std").build.Builder;
pub fn build(b: *Builder) void {
const target = b.standardTargetOptions(.{});
const mode = b.standardReleaseOptions();
const c_obj = b.addObject("stb_image_write", null);
c_obj.setBuildMode(mode);
c_obj.addCSourceFile("stb_image_write/stb_image_write.c", &[_][]const u8{"-fno-strict-aliasing"});
c_obj.linkSystemLibrary("c");
const exe = b.addExecutable("generative", "main.zig");
exe.setTarget(target);
exe.setBuildMode(mode);
exe.addObject(c_obj);
exe.addIncludeDir("stb_image_write");
exe.install();
const run_cmd = exe.run();
run_cmd.step.dependOn(b.getInstallStep());
const run_step = b.step("run", "Run the app");
run_step.dependOn(&run_cmd.step);
}