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
52
53
54
55
56
57
58
59
60
61
62
63
64
|
const std = @import("std");
const builtin = @import("builtin");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const root = b.addModule("game-mod", .{
.optimize = optimize,
.target = target,
.link_libc = true,
});
root.addCSourceFiles(.{
.files = &[_][]const u8 {
"src/main.c",
"src/utils/stringBuilder.c",
"src/wren_inter/wren_inter.c",
"src/resources/resources.c",
"src/ui_elements/UI.c",
"src/ui_elements/TextEditor.c",
"src/scenes/sceneManager.c",
"src/scenes/mainMenu.c",
"src/scenes/resultView.c",
"src/scenes/puzzleScene.c",
"src/puzzles/puzzle.c",
}
});
// Linking raylib
if (builtin.target.os.tag == .windows) {
// If you are building on windows you need to provide your own
// raylib. Put it in the raylib dir
root.addLibraryPath(b.path("raylib/lib/"));
root.addIncludePath(b.path("raylib/include/"));
}
root.linkSystemLibrary("raylib", .{.needed = true});
root.addIncludePath(b.path("include/"));
// Linking wren. They do not provide system-wide libraries so you have to
// provide them yourself
root.addIncludePath(b.path("wren/src/include/"));
root.addLibraryPath(b.path("wren/lib/"));
root.linkSystemLibrary("wren", .{
.needed = true,
.preferred_link_mode = .static,
});
const exe = b.addExecutable(.{
.name = "game",
.root_module = root,
});
b.installArtifact(exe);
const run_step = b.step("run", "Run the app");
const run_cmd = b.addRunArtifact(exe);
run_step.dependOn(&run_cmd.step);
if (b.args) |args| {
run_cmd.addArgs(args);
}
}
|