-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.zig
42 lines (42 loc) · 1.48 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
35
36
37
38
39
40
41
42
const std = @import("std");
const sdl = @import("SDL.zig/Sdk.zig");
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const ecsModule = b.createModule(.{
.root_source_file = .{ .path = "ZEngine/zig-ecs/src/ecs.zig" },
.target = target,
.optimize = optimize,
});
const zengineModule = b.createModule(.{
.root_source_file = .{ .path = "ZEngine/src/zengine.zig" },
.target = target,
.optimize = optimize,
});
zengineModule.addImport("ecs", ecsModule);
const zlmModule = b.createModule(.{
.root_source_file = .{ .path = "zlm/src/zlm.zig" },
.target = target,
.optimize = optimize,
});
const exe = b.addExecutable(.{
.name = "examples",
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("ecs", ecsModule);
exe.root_module.addImport("zengine", zengineModule);
exe.root_module.addImport("zlm", zlmModule);
var sdlSdk = sdl.init(b, null);
sdlSdk.link(exe, .dynamic);
exe.root_module.addImport("sdl", sdlSdk.getWrapperModule());
exe.addIncludePath(.{.path = "src/"});
exe.addCSourceFile(.{
.file = .{.path = "src/stb_image.c"},
});
b.installArtifact(exe);
const run = b.addRunArtifact(exe);
const runStep = b.step("run", "run the example");
runStep.dependOn(&run.step);
}