Skip to content

Commit 59175cf

Browse files
committed
Fixup optimize mode option
1 parent 5cf650a commit 59175cf

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

build.zig

+5-9
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@ const std = @import("std");
22

33
pub fn build(b: *std.Build) void {
44
const target = b.standardTargetOptions(.{});
5+
const optimize = b.standardOptimizeOption(.{
6+
.preferred_optimize_mode = .ReleaseFast,
7+
});
58

69
const options = .{
7-
.optimize = b.option(
8-
std.builtin.OptimizeMode,
9-
"optimize",
10-
"Select optimization mode",
11-
) orelse b.standardOptimizeOption(.{
12-
.preferred_optimize_mode = .ReleaseFast,
13-
}),
1410
.enable_cross_platform_determinism = b.option(
1511
bool,
1612
"enable_cross_platform_determinism",
@@ -38,7 +34,7 @@ pub fn build(b: *std.Build) void {
3834
.name = "zmath-tests",
3935
.root_source_file = b.path("src/root.zig"),
4036
.target = target,
41-
.optimize = options.optimize,
37+
.optimize = optimize,
4238
});
4339
b.installArtifact(tests);
4440

@@ -52,7 +48,7 @@ pub fn build(b: *std.Build) void {
5248
.name = "zmath-benchmarks",
5349
.root_source_file = b.path("src/benchmark.zig"),
5450
.target = target,
55-
.optimize = options.optimize,
51+
.optimize = optimize,
5652
});
5753
b.installArtifact(benchmarks);
5854

0 commit comments

Comments
 (0)