diff options
| author | Patrick | 2026-10-05 19:01:09 +0200 |
|---|---|---|
| committer | Patrick | 2026-10-05 19:01:09 +0200 |
| commit | bd3f5d3455ed523f58fd292b33db2cece1013cdf (patch) | |
| tree | 5b3b111eda73f59befcb4b0ecd80af5105ad522d /build.zig | |
| parent | 2e19a1b44b366547563f5c5686455a1227a8fcbd (diff) | |
| download | sg3-bd3f5d3455ed523f58fd292b33db2cece1013cdf.tar.gz sg3-bd3f5d3455ed523f58fd292b33db2cece1013cdf.zip | |
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); } |
