Skip to content

Commit dea3ed7

Browse files
Ivancastholm
andauthored
build: fix error in standalone test when using --release
Co-authored-by: Carl Åstholm <[email protected]>
1 parent bb29846 commit dea3ed7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/standalone/dependency_options/build.zig

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@ pub fn build(b: *std.Build) !void {
1010

1111
const none_specified_mod = none_specified.module("dummy");
1212
if (!none_specified_mod.resolved_target.?.query.eql(b.graph.host.query)) return error.TestFailed;
13-
if (none_specified_mod.optimize.? != .Debug) return error.TestFailed;
13+
const expected_optimize: std.builtin.OptimizeMode = switch (b.release_mode) {
14+
.off => .Debug,
15+
.any => unreachable,
16+
.fast => .ReleaseFast,
17+
.safe => .ReleaseSafe,
18+
.small => .ReleaseSmall,
19+
};
20+
if (none_specified_mod.optimize.? != expected_optimize) return error.TestFailed;
1421

1522
// Passing null is the same as not specifying the option,
1623
// so this should resolve to the same cached dependency instance.

0 commit comments

Comments
 (0)