summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorandromeda <andromeda@lenovo>2026-06-12 19:03:28 +0200
committerandromeda <andromeda@lenovo>2026-06-12 19:03:28 +0200
commitd3a1fe476d6ce9cac90fea61d03f8158b2d09c0e (patch)
tree637e2c65be1985314d6589681545e3412b6a7437 /build.zig
parent3497d178379d34c604fd88aa41b8b6a8de6429bc (diff)
rgfw example
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig26
1 files changed, 21 insertions, 5 deletions
diff --git a/build.zig b/build.zig
index e837ad5..96a2b06 100644
--- a/build.zig
+++ b/build.zig
@@ -1,14 +1,30 @@
const std = @import("std");
pub fn build(b: *std.Build) void {
+ const target = b.standardTargetOptions(.{});
+// const optimize = b.standardOptimizeOption(.{});
+
+ const term = b.createModule(.{
+ .root_source_file = b.path("main.zig"),
+ .target = target,
+ .link_libc = true,
+ });
+
+ term.addCMacro("RGFW_IMPLEMENTATION", "");
+ term.addCMacro("RGFW_OPENGL", "");
+ term.addIncludePath(b.path("include"));
+ term.addCSourceFile(.{
+ .file = b.addWriteFiles().add("rgfw.c", "#include <RGFW.h>"),
+ });
+
+ term.linkSystemLibrary("GL", .{});
+ term.linkSystemLibrary("X11", .{});
+ term.linkSystemLibrary("Xrandr", .{});
+
const exe = b.addExecutable(.{
.name = "term",
- .root_module = b.createModule(.{
- .root_source_file = b.path("main.zig"),
- .target = b.graph.host,
- }),
+ .root_module = term,
});
-
b.installArtifact(exe);
const run_exe = b.addRunArtifact(exe);