-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.zig
34 lines (28 loc) · 1.53 KB
/
build.zig
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
const std = @import("std");
const raylib_build = @import("raylib_build.zig");
const box2c_build = @import("box2c_build.zig");
const demo_build = @import("demo_build.zig");
const tutorial_example_build = @import("tutorial_example_build.zig");
// Although this function looks imperative, note that its job is to
// declaratively construct a build graph that will be executed by an external
// runner.
pub fn build(b: *std.Build) void {
// Standard target options allows the person running `zig build` to choose
// what target to build for. Here we do not override the defaults, which
// means any target is allowed, and the default is native. Other options
// for restricting supported target set are available.
const target = b.standardTargetOptions(.{});
// Standard optimization options allow the person running `zig build` to select
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. Here we do not
// set a preferred release mode, allowing the user to decide how to optimize.
const optimize = b.standardOptimizeOption(.{
// For best performance
.preferred_optimize_mode = std.builtin.OptimizeMode.ReleaseFast,
// For best binary size
// .preferred_optimize_mode = std.builtin.OptimizeMode.ReleaseSmall,
});
const raylib_build_cmd_step = raylib_build.build(b);
const box2c_lib = box2c_build.build(b, target, optimize, raylib_build_cmd_step);
demo_build.build(b, target, optimize, box2c_lib);
tutorial_example_build.build(b, target, optimize, box2c_lib);
}