diff options
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -60,12 +60,13 @@ pub fn build(b: *std.Build) void { .bytecode = true, }) catch undefined; - const exe = b.addExecutable(.{ + const exe_options: std.Build.ExecutableOptions = .{ .name = "rc2d", .root_module = b.createModule(.{ .root_source_file = b.path("src/main.zig"), .target = target, .optimize = optimize, + .link_libc = true, .imports = &.{ .{ .name = "stbi", .module = tc_stb.mod }, .{ .name = "zigimg", .module = zigimg_dependency.module("zigimg") }, @@ -73,10 +74,10 @@ pub fn build(b: *std.Build) void { .{ .name = cimgui_conf.module_name, .module = dep_cimgui.module(cimgui_conf.module_name) }, }, }), - }); + }; + const exe = b.addExecutable(exe_options); exe.root_module.linkLibrary(dep_sokol.artifact("sokol_clib")); - exe.root_module.link_libc = true; exe.root_module.addCSourceFile(.{.file = b.path("deps/stb/stb_image.c")}); exe.step.dependOn(shader); @@ -86,4 +87,8 @@ pub fn build(b: *std.Build) void { } b.installArtifact(exe); + + const exe_check = b.addExecutable(exe_options); + const check = b.step("check", "Check if it compiles"); + check.dependOn(&exe_check.step); } |
