diff options
| author | andromeda <andromeda@lenovo> | 2026-06-12 19:03:28 +0200 |
|---|---|---|
| committer | andromeda <andromeda@lenovo> | 2026-06-12 19:03:28 +0200 |
| commit | d3a1fe476d6ce9cac90fea61d03f8158b2d09c0e (patch) | |
| tree | 637e2c65be1985314d6589681545e3412b6a7437 /build.zig | |
| parent | 3497d178379d34c604fd88aa41b8b6a8de6429bc (diff) | |
rgfw example
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 26 |
1 files changed, 21 insertions, 5 deletions
@@ -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); |
