diff options
| author | andromeda <andromeda@lenovo> | 2026-06-14 22:46:08 +0200 |
|---|---|---|
| committer | andromeda <andromeda@lenovo> | 2026-06-14 22:46:08 +0200 |
| commit | 27818005ee80ea30b5278b4ce92af043c8aa0cbc (patch) | |
| tree | 479f265132409116288b8589239719ff9bf1b56c /build.zig | |
| parent | 00205c3111c41018aad135456a70ecb4943cb8f0 (diff) | |
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 24 |
1 files changed, 17 insertions, 7 deletions
@@ -30,28 +30,38 @@ pub fn build(b: *std.Build) !void { std.debug.panic("no backend other than OpenGL supported by RSGL.h", .{}); } - const rgfw = b.addTranslateC(.{ + const rgfw_raw = b.addTranslateC(.{ .root_source_file = b.path("include/RGFW.h"), .target = target, .optimize = optimize, }); - for (macros.items) |macro| {rgfw.defineCMacro(macro[0], macro[1]);} - const rgfw_mod = rgfw.addModule("rgfw"); + for (macros.items) |macro| {rgfw_raw.defineCMacro(macro[0], macro[1]);} + const rgfw_raw_mod = rgfw_raw.addModule("rgfw_raw"); - const rsgl = b.addTranslateC(.{ + const rsgl_raw = b.addTranslateC(.{ .root_source_file = b.path("include/RSGL_gl.h"), .target = target, .optimize = optimize, }); - for (macros.items) |macro| {rsgl.defineCMacro(macro[0], macro[1]);} - const rsgl_mod = rsgl.addModule("rsgl"); + for (macros.items) |macro| {rsgl_raw.defineCMacro(macro[0], macro[1]);} + const rsgl_raw_mod = rsgl_raw.addModule("rsgl"); + + const rsgl_mod = b.createModule(.{ + .root_source_file = b.path("rsgl.zig"), + .target = target, + .optimize = optimize, + .imports = &.{ + .{.name = "rsgl_raw", .module = rsgl_raw_mod}, + }, + }); const term = b.createModule(.{ .root_source_file = b.path("main.zig"), .target = target, .optimize = optimize, .imports = &.{ - .{.name = "rgfw", .module = rgfw_mod}, + .{.name = "rgfw_raw", .module = rgfw_raw_mod}, + .{.name = "rsgl_raw", .module = rsgl_raw_mod}, .{.name = "rsgl", .module = rsgl_mod}, }, }); |
