daq-view/build.zig
2024-10-25 13:27:48 +03:00

56 lines
1.6 KiB
Zig

const std = @import("std");
const Module = std.Build.Module;
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const libdaq_dep = b.dependency("libdaq", .{});
_ = libdaq_dep; // TODO: Build libdaq
var lib: *Module = undefined;
{
lib = b.createModule(.{
.root_source_file = b.path("src/root.zig"),
.target = target,
.optimize = optimize,
});
const unit_tests = b.addTest(.{
.root_source_file = b.path("src/root.zig"),
.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);
}
{
const raylib_dep = b.dependency("raylib-zig", .{
.target = target,
.optimize = optimize,
});
const exe = b.addExecutable(.{
.name = "daq-view",
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
exe.linkLibrary(raylib_dep.artifact("raylib"));
exe.root_module.addImport("raylib", raylib_dep.module("raylib"));
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 program");
run_step.dependOn(&run_cmd.step);
}
}