X-Git-Url: https://gitweb.ps.run/sporegirl/blobdiff_plain/f23222b4a847768225c50a37c9659a58865796c1..df3724db278d0a4f42943d0c9390cd1274398370:/build.zig diff --git a/build.zig b/build.zig index 590d913..0fe3fbf 100644 --- 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()) {