26 lines
852 B
Zig
26 lines
852 B
Zig
const std = @import("std");
|
|
|
|
pub fn build(b: *std.build.Builder) void {
|
|
const mode = b.standardReleaseOptions();
|
|
const target = b.standardTargetOptions(.{});
|
|
const test_step = b.step("test", "Run library tests");
|
|
test_step.dependOn(&testStep(b, mode, target).step);
|
|
}
|
|
|
|
pub fn testStep(b: *std.build.Builder, mode: std.builtin.Mode, target: std.zig.CrossTarget) *std.build.RunStep {
|
|
const main_tests = b.addTestExe("ecs-tests", (comptime thisDir()) ++ "/src/main.zig");
|
|
main_tests.setBuildMode(mode);
|
|
main_tests.setTarget(target);
|
|
main_tests.install();
|
|
return main_tests.run();
|
|
}
|
|
|
|
pub const pkg = std.build.Pkg{
|
|
.name = "ecs",
|
|
.source = .{ .path = thisDir() ++ "/src/main.zig" },
|
|
.dependencies = &[_]std.build.Pkg{},
|
|
};
|
|
|
|
fn thisDir() []const u8 {
|
|
return std.fs.path.dirname(@src().file) orelse ".";
|
|
}
|