diff options
| author | Nic Gaffney <gaffney_nic@protonmail.com> | 2025-10-13 02:49:48 -0500 |
|---|---|---|
| committer | Nic Gaffney <gaffney_nic@protonmail.com> | 2025-10-13 02:49:48 -0500 |
| commit | 167fdaf8b41d19f119df8484f004d968e9fc68fd (patch) | |
| tree | bc17f87c2c14638e3ac004847c9d26e20ffc418a /build.zig | |
| parent | 2f1f9beb60309df8d2de011b19402a79ef8101fa (diff) | |
| download | particle-sim-167fdaf8b41d19f119df8484f004d968e9fc68fd.tar.gz | |
Update to zig 0.15.1 complete, along with further optimization
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 53 |
1 files changed, 30 insertions, 23 deletions
@@ -4,35 +4,42 @@ pub fn build(b: *std.Build) !void { const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{ .preferred_optimize_mode = .ReleaseFast }); - const exe = b.addExecutable(.{ - .name = "particle-sim", - .root_source_file = b.path("src/main.zig"), - .target = target, - .optimize = optimize, - }); - exe.linkLibCpp(); - const raylib_zig = b.dependency("raylib-zig", .{ + const raylib_zig = b.dependency("raylib_zig", .{ .target = target, .optimize = optimize, }); - const raylib = raylib_zig.module("raylib"); const raylib_artifact = raylib_zig.artifact("raylib"); - exe.linkLibrary(raylib_artifact); - exe.root_module.addImport("raylib", raylib); const zgui = b.dependency("zgui", .{ .shared = false, .with_implot = true, }); - exe.root_module.addImport("zgui", zgui.module("root")); - exe.linkLibrary(zgui.artifact("imgui")); - exe.addIncludePath(b.path("vendor/zgui/libs/imgui")); const rlimgui = b.dependency("rlimgui", .{ .target = target, .optimize = optimize, }); + + const exe = b.addExecutable(.{ + .name = "particle-sim", + .root_module = b.createModule(.{ + .root_source_file = b.path("src/main.zig"), + .link_libcpp = true, + .imports = &.{ + .{ .name = "raylib", .module = raylib_zig.module("raylib") }, + .{ .name = "zgui", .module = zgui.module("root") }, + }, + .target = target, + .optimize = optimize, + }), + }); + // exe.linkLibCpp(); + exe.linkLibrary(raylib_artifact); + exe.linkLibrary(zgui.artifact("imgui")); + exe.addIncludePath(zgui.path("libs/imgui")); + + exe.root_module.addCSourceFile(.{ .file = rlimgui.path("rlImGui.cpp"), .flags = &.{ @@ -54,14 +61,14 @@ pub fn build(b: *std.Build) !void { const run_step = b.step("run", "Run the app"); run_step.dependOn(&run_cmd.step); - const exe_unit_tests = b.addTest(.{ - .root_source_file = b.path("src/quad.zig"), - .target = target, - .optimize = optimize, - }); - - const run_exe_unit_tests = b.addRunArtifact(exe_unit_tests); + // const exe_unit_tests = b.addTest(.{ + // .root_source_file = b.path("src/quad.zig"), + // .target = target, + // .optimize = optimize, + // }); - const test_step = b.step("test", "Run unit tests"); - test_step.dependOn(&run_exe_unit_tests.step); + // const run_exe_unit_tests = b.addRunArtifact(exe_unit_tests); + // + // const test_step = b.step("test", "Run unit tests"); + // test_step.dependOn(&run_exe_unit_tests.step); } |
