-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.zig
More file actions
51 lines (39 loc) · 1.3 KB
/
Copy pathbuild.zig
File metadata and controls
51 lines (39 loc) · 1.3 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// build.zig
const std = @import("std");
const sdl = @import("SDL2"); // Name from build.zig.zon
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const root_module = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
const exe = b.addExecutable(.{
.name = "pixels",
.root_module = root_module,
});
// allow for release compilation
b.installArtifact(exe);
// SDL2
const sdk = sdl.init(b, .{
.dep_name = "SDL2",
});
// sdk.link(exe, .dynamic, sdl.Library.SDL2);
sdk.link(exe, .static, sdl.Library.SDL2);
root_module.addImport("sdl2", sdk.getWrapperModule());
// zflecs
const zflecs = b.dependency("zflecs", .{});
root_module.addImport("zflecs", zflecs.module("root"));
exe.linkLibrary(zflecs.artifact("flecs"));
// tinyc2
// gemini zig rewrite
const antigravity_c2 = b.createModule(.{
.root_source_file = b.path("lib/cute_c2/zoot_c2.zig"),
});
root_module.addImport("zig_c2", antigravity_c2);
// TESTS
const run_exe = b.addRunArtifact(exe);
const run_step = b.step("run", "Run pixels");
run_step.dependOn(&run_exe.step);
}