You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

65 lines
2.0 KiB

const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
// Create the pi-finder module locally
const pi_finder_module = b.createModule(.{
.root_source_file = b.path("../../src/lib.zig"),
});
const exe = b.addExecutable(.{
.name = "birth-date-finder",
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("pi-finder", pi_finder_module);
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);
// Add test executable
const test_exe = b.addExecutable(.{
.name = "test-multiple",
.root_source_file = b.path("src/test_multiple.zig"),
.target = target,
.optimize = optimize,
});
test_exe.root_module.addImport("pi-finder", pi_finder_module);
b.installArtifact(test_exe);
const test_run_cmd = b.addRunArtifact(test_exe);
test_run_cmd.step.dependOn(b.getInstallStep());
const test_step = b.step("test-multiple", "Run multiple tests");
test_step.dependOn(&test_run_cmd.step);
// Add plain text example executable
const plain_text_exe = b.addExecutable(.{
.name = "plain-text-example",
.root_source_file = b.path("src/plain_text_example.zig"),
.target = target,
.optimize = optimize,
});
plain_text_exe.root_module.addImport("pi-finder", pi_finder_module);
b.installArtifact(plain_text_exe);
const plain_text_run_cmd = b.addRunArtifact(plain_text_exe);
plain_text_run_cmd.step.dependOn(b.getInstallStep());
const plain_text_step = b.step("plain-text", "Run the plain text format example");
plain_text_step.dependOn(&plain_text_run_cmd.step);
}