summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig24
1 files changed, 17 insertions, 7 deletions
diff --git a/build.zig b/build.zig
index 8c5eefa..99d8664 100644
--- a/build.zig
+++ b/build.zig
@@ -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},
},
});