X-Git-Url: https://gitweb.ps.run/sporegirl/blobdiff_plain/85192a41f309b9cd98900f284e5a56e0dc22bccc..HEAD:/build.zig diff --git a/build.zig b/build.zig index 0fe3fbf..8742838 100644 --- a/build.zig +++ b/build.zig @@ -5,6 +5,7 @@ const ResolvedTarget = Build.ResolvedTarget; 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(.{}); @@ -30,11 +31,11 @@ pub fn build(b: *Build) !void { // 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 }, }); @@ -64,16 +65,27 @@ pub fn build(b: *Build) !void { } 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; }