]> gitweb.ps.run Git - sporegirl/blobdiff - build.zig
move shader, update build.zig
[sporegirl] / build.zig
index 590d91308187984b54925918ffcfe032c42fef4a..0fe3fbf063b9dc62f2e2fbfbc7fe5121ac0f045c 100644 (file)
--- a/build.zig
+++ b/build.zig
@@ -10,11 +10,9 @@ pub fn build(b: *Build) !void {
     const target = b.standardTargetOptions(.{});
     const optimize = b.standardOptimizeOption(.{});
 
-    const opt_docking = b.option(bool, "docking", "Build with docking support") orelse false;
-
     // Get the matching Zig module name, C header search path and C library for
     // vanilla imgui vs the imgui docking branch.
-    const cimgui_conf = cimgui.getConfig(opt_docking);
+    const cimgui_conf = cimgui.getConfig(true);
 
     // note that the sokol dependency is built with `.with_sokol_imgui = true`
     const dep_sokol = b.dependency("sokol", .{
@@ -35,8 +33,8 @@ pub fn build(b: *Build) !void {
     const dep_shdc = dep_sokol.builder.dependency("shdc", .{});
     const shdc_step = try sokol.shdc.createSourceFile(b, .{
         .shdc_dep = dep_shdc,
-        .input = "src/shader/quad.glsl",
-        .output = "src/shader/quad.glsl.zig",
+        .input = "shd/quad.glsl",
+        .output = "src/shd/quad.glsl.zig",
         .slang = .{ .glsl430 = true },
     });
 
@@ -49,10 +47,11 @@ pub fn build(b: *Build) !void {
             .{ .name = "sokol", .module = dep_sokol.module("sokol") },
             .{ .name = cimgui_conf.module_name, .module = dep_cimgui.module(cimgui_conf.module_name) },
         },
+        .link_libc = true,
     });
-    const mod_options = b.addOptions();
-    mod_options.addOption(bool, "docking", opt_docking);
-    mod_main.addOptions("build_options", mod_options);
+    
+    mod_main.addIncludePath(b.path("src"));
+    mod_main.addCSourceFile(.{.file = b.path("src/stb_image.c")});
 
     // from here on different handling for native vs wasm builds
     if (target.result.cpu.arch.isWasm()) {