@@ -3,8 +3,12 @@ const builtin = @import("builtin");
3
3
const mem = std .mem ;
4
4
const Build = std .Build ;
5
5
const Step = Build .Step ;
6
+ const MakeOptions = if (@hasDecl (Step , "MakeOptions" ))
7
+ Step .MakeOptions
8
+ else
9
+ std .Progress .Node ;
6
10
7
- pub fn build (b : * std. Build ) void {
11
+ pub fn build (b : * Build ) void {
8
12
if (comptime ! checkVersion ())
9
13
@compileError ("Update your zig toolchain to >= 0.13.0" );
10
14
@@ -156,13 +160,7 @@ pub fn build(b: *std.Build) void {
156
160
157
161
const test_step = b .step ("test" , "Run lmdb tests" );
158
162
const run_create_testdb = struct {
159
- fn makeFn (step : * Step , options : blk : {
160
- if (@hasDecl (std .Build .Step , "MakeOptions" )) {
161
- break :blk std .Build .Step .MakeOptions ;
162
- } else {
163
- break :blk std .Progress .Node ;
164
- }
165
- }) ! void {
163
+ fn makeFn (step : * Step , options : MakeOptions ) ! void {
166
164
_ = options ;
167
165
const test_run = Step .cast (step , Step .Run ).? ;
168
166
const subpath = "testdb/" ;
@@ -195,13 +193,7 @@ pub fn build(b: *std.Build) void {
195
193
196
194
const install_test_subpath = "test/" ;
197
195
install_test_step .makeFn = struct {
198
- fn makeFn (step : * std.Build.Step , options : blk : {
199
- if (@hasDecl (std .Build .Step , "MakeOptions" )) {
200
- break :blk std .Build .Step .MakeOptions ;
201
- } else {
202
- break :blk std .Progress .Node ;
203
- }
204
- }) ! void {
196
+ fn makeFn (step : * Step , options : MakeOptions ) ! void {
205
197
_ = options ;
206
198
const step_build = step .owner ;
207
199
std .fs .cwd ().makeDir (step_build .fmt (
0 commit comments