-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.zig
40 lines (31 loc) · 1.11 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
// SPDX-FileCopyrightText: NONE
// SPDX-License-Identifier: CC0-1.0
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const exe = b.addExecutable(.{
.name = "zigglgen_example",
.root_source_file = b.path("main.zig"),
.target = target,
.optimize = optimize,
});
exe.root_module.addAnonymousImport("shims", .{ .root_source_file = b.path("../shims.zig") });
const sdl_dep = b.dependency("sdl", .{
.target = target,
.optimize = optimize,
});
const sdl_lib = sdl_dep.artifact("SDL3");
exe.root_module.linkLibrary(sdl_lib);
// Generate OpenGL 4.1 bindings at build time.
exe.root_module.addImport("gl", @import("zigglgen").generateBindingsModule(b, .{
.api = .gl,
.version = .@"4.1",
.profile = .core,
}));
b.installArtifact(exe);
const run_exe = b.addRunArtifact(exe);
run_exe.step.dependOn(b.getInstallStep());
const run = b.step("run", "Run the app");
run.dependOn(&run_exe.step);
}