dropshell/source/build.zig
Your Name 08794e6480
Some checks failed
Dropshell Test / Build_and_Test (push) Failing after 1m43s
LOL Zig
2025-05-25 23:04:39 +12:00

41 lines
1.1 KiB
Zig

const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const exe = b.addExecutable(.{
.name = "dropshell",
.target = target,
.optimize = optimize,
.root_source_file = .{ .cwd_relative = "src/main.cpp" },
});
// Link with C++ standard library
exe.linkLibCpp();
// Add include directories if needed
exe.addIncludePath(.{ .cwd_relative = "include" });
b.installArtifact(exe);
const run_cmd = b.addRunArtifact(exe);
run_cmd.step.dependOn(b.getInstallStep());
if (b.args) |args| {
run_cmd.addArgs(args);
}
const run_step = b.step("run", "Run the app");
run_step.dependOn(&run_cmd.step);
const unit_tests = b.addTest(.{
.root_source_file = .{ .cwd_relative = "src/main.cpp" },
.target = target,
.optimize = optimize,
});
const run_unit_tests = b.addRunArtifact(unit_tests);
const test_step = b.step("test", "Run unit tests");
test_step.dependOn(&run_unit_tests.step);
}