diff options
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); |
