const Dependency = Build.Dependency;
const sokol = @import("sokol");
const cimgui = @import("cimgui");
+const shdc = @import("shdc");
pub fn build(b: *Build) !void {
const target = b.standardTargetOptions(.{});
// shaders
dep_sokol.artifact("sokol_clib").addIncludePath(b.path("ext/cimgui"));
- const dep_shdc = dep_sokol.builder.dependency("shdc", .{});
- const shdc_step = try sokol.shdc.createSourceFile(b, .{
+ const dep_shdc = b.dependency("shdc", .{});
+ const shdc_step = try shdc.createSourceFile(b, .{
.shdc_dep = dep_shdc,
- .input = "shd/quad.glsl",
- .output = "src/shd/quad.glsl.zig",
+ .input = "shd/main.glsl",
+ .output = "src/shd/main.glsl.zig",
.slang = .{ .glsl430 = true },
});
} else {
const exe = try buildNative(b, mod_main);
exe.step.dependOn(shdc_step);
+
+ exe.root_module.link_libc = true;
+ exe.root_module.linkSystemLibrary("X11", .{ .needed = true });
+ exe.root_module.linkSystemLibrary("Xcursor", .{ .needed = true });
+
+ const exe_check = b.addExecutable(.{
+ .name = "sporegirl",
+ .root_module = mod_main,
+ });
+ const check = b.step("check", "Check");
+ check.dependOn(&exe_check.step);
}
}
fn buildNative(b: *Build, mod: *Build.Module) !*Build.Step.Compile {
const exe = b.addExecutable(.{
- .name = "demo",
+ .name = "sporegirl",
.root_module = mod,
});
b.installArtifact(exe);
- b.step("run", "Run demo").dependOn(&b.addRunArtifact(exe).step);
+ b.step("run", "Run Sporegirl").dependOn(&b.addRunArtifact(exe).step);
return exe;
}