From 73779432622ee6f88fa6280be380e02966bd2e28 Mon Sep 17 00:00:00 2001 From: Vincent Rischmann Date: Tue, 4 Jan 2022 00:48:38 +0100 Subject: build: add some comments to clarify what we're doing --- build.zig | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'build.zig') diff --git a/build.zig b/build.zig index 5837e88..7098c98 100644 --- a/build.zig +++ b/build.zig @@ -153,6 +153,8 @@ pub fn build(b: *std.build.Builder) !void { const target = b.standardTargetOptions(.{}); + // If the target is native we assume the user didn't change it with -Dtarget and run all test targets. + // Otherwise we run a single test target. const test_targets = if (target.isNative()) &all_test_targets else @@ -162,6 +164,12 @@ pub fn build(b: *std.build.Builder) !void { }}; const test_step = b.step("test", "Run library tests"); + + // By default the tests will only be execute for native test targets, however they will be compiled + // for _all_ targets defined in `test_targets`. + // + // If you want to execute tests for other targets you can pass -fqemu, -fdarling, -fwine, -frosetta. + for (test_targets) |test_target| { const bundled = use_bundled orelse test_target.bundled; const cross_target = getTarget(test_target.target, bundled); -- cgit v1.2.3