From d3a1fe476d6ce9cac90fea61d03f8158b2d09c0e Mon Sep 17 00:00:00 2001 From: andromeda Date: Fri, 12 Jun 2026 19:03:28 +0200 Subject: rgfw example --- build.zig | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'build.zig') 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 "), + }); + + 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); -- cgit v1.3.1