2024-02-11 19:29:23 -06:00
|
|
|
const std = @import("std");
|
|
|
|
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
|
|
const target = b.standardTargetOptions(.{});
|
|
|
|
|
|
|
|
const optimize = b.standardOptimizeOption(.{});
|
|
|
|
|
|
|
|
_ = b.addModule("hidapi", .{
|
2024-06-16 12:28:14 -05:00
|
|
|
.root_source_file = b.path("src/hidapi.zig"),
|
2024-02-11 19:29:23 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
const unit_tests = b.addTest(.{
|
2024-06-16 12:28:14 -05:00
|
|
|
.root_source_file = b.path("src/hidapi.zig"),
|
2024-02-11 19:29:23 -06:00
|
|
|
.target = target,
|
|
|
|
.optimize = optimize,
|
|
|
|
});
|
|
|
|
|
|
|
|
unit_tests.linkLibC();
|
|
|
|
unit_tests.linkSystemLibrary("hidapi-libusb");
|
|
|
|
|
|
|
|
const run_unit_tests = b.addRunArtifact(unit_tests);
|
|
|
|
|
|
|
|
const test_step = b.step("test", "Run unit tests");
|
|
|
|
test_step.dependOn(&run_unit_tests.step);
|
|
|
|
}
|