| ... | ... | @@ -352,11 +352,13 @@ fn findAndParseConfigH(b: *Builder) !Context { |
| 352 | 352 | const max_bytes = 1 * 1024 * 1024; |
| 353 | 353 | const config_h_text = dir.readFileAlloc(b.allocator, "config.h", max_bytes) catch |err| switch (err) { |
| 354 | 354 | error.FileNotFound => { |
| 355 | | check_dir = fs.path.dirname(check_dir) orelse { |
| 355 | const new_check_dir = fs.path.dirname(check_dir); |
| 356 | if (new_check_dir == null or mem.eql(u8, new_check_dir.?, check_dir)) { |
| 356 | 357 | std.debug.warn("Unable to find config.h file relative to Zig executable.\n", .{}); |
| 357 | 358 | std.debug.warn("`zig build` must be run using a Zig executable within the source tree.\n", .{}); |
| 358 | 359 | std.process.exit(1); |
| 359 | | }; |
| 360 | } |
| 361 | check_dir = new_check_dir.?; |
| 360 | 362 | continue; |
| 361 | 363 | }, |
| 362 | 364 | else => |e| return e, |