ecs: update to latest Zig build API
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
4e9fbbdd4d
commit
8c72c124e2
1 changed files with 14 additions and 10 deletions
|
|
@ -1,22 +1,26 @@
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
|
|
||||||
pub const pkg = std.build.Pkg{
|
pub const pkg = std.build.AddModuleOptions{
|
||||||
.name = "ecs",
|
.name = "ecs",
|
||||||
.source = .{ .path = sdkPath("/src/main.zig") },
|
.source_file = .{ .path = sdkPath("/src/main.zig") },
|
||||||
.dependencies = &[_]std.build.Pkg{},
|
.dependencies = &[_]std.build.AddModuleOptions{},
|
||||||
};
|
};
|
||||||
|
|
||||||
pub fn build(b: *std.build.Builder) void {
|
pub fn build(b: *std.Build) void {
|
||||||
const mode = b.standardReleaseOptions();
|
const optimize = b.standardOptimizeOption(.{});
|
||||||
const target = b.standardTargetOptions(.{});
|
const target = b.standardTargetOptions(.{});
|
||||||
const test_step = b.step("test", "Run library tests");
|
const test_step = b.step("test", "Run library tests");
|
||||||
test_step.dependOn(&testStep(b, mode, target).step);
|
test_step.dependOn(&testStep(b, optimize, target).step);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn testStep(b: *std.build.Builder, mode: std.builtin.Mode, target: std.zig.CrossTarget) *std.build.RunStep {
|
pub fn testStep(b: *std.Build, optimize: std.builtin.OptimizeMode, target: std.zig.CrossTarget) *std.build.RunStep {
|
||||||
const main_tests = b.addTestExe("ecs-tests", sdkPath("/src/main.zig"));
|
const main_tests = b.addTest(.{
|
||||||
main_tests.setBuildMode(mode);
|
.name = "ecs-tests",
|
||||||
main_tests.setTarget(target);
|
.kind = .test_exe,
|
||||||
|
.root_source_file = .{ .path = sdkPath("/src/main.zig") },
|
||||||
|
.target = target,
|
||||||
|
.optimize = optimize,
|
||||||
|
});
|
||||||
main_tests.install();
|
main_tests.install();
|
||||||
return main_tests.run();
|
return main_tests.run();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue