File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,13 @@ const std = @import("std");
2
2
3
3
pub fn build (b : * std.Build ) void {
4
4
const target = b .standardTargetOptions (.{});
5
- const optimize = b .standardOptimizeOption (.{
6
- .preferred_optimize_mode = .ReleaseFast ,
7
- });
8
5
9
6
const options = .{
7
+ .optimize = b .option (
8
+ std .builtin .OptimizeMode ,
9
+ "optimize" ,
10
+ "The optimization level to use for the build" ,
11
+ ) orelse .ReleaseFast ,
10
12
.enable_cross_platform_determinism = b .option (
11
13
bool ,
12
14
"enable_cross_platform_determinism" ,
@@ -34,7 +36,7 @@ pub fn build(b: *std.Build) void {
34
36
.name = "zmath-tests" ,
35
37
.root_source_file = b .path ("src/root.zig" ),
36
38
.target = target ,
37
- .optimize = optimize ,
39
+ .optimize = options . optimize ,
38
40
});
39
41
b .installArtifact (tests );
40
42
@@ -48,7 +50,7 @@ pub fn build(b: *std.Build) void {
48
50
.name = "zmath-benchmarks" ,
49
51
.root_source_file = b .path ("src/benchmark.zig" ),
50
52
.target = target ,
51
- .optimize = optimize ,
53
+ .optimize = options . optimize ,
52
54
});
53
55
b .installArtifact (benchmarks );
54
56
You can’t perform that action at this time.
0 commit comments