| ... | @@ -555,34 +555,35 @@ const LazyIncludePaths = struct { | ... | @@ -555,34 +555,35 @@ const LazyIncludePaths = struct { |
| 555 | ) ![]const []const u8 { | 555 | ) ![]const []const u8 { |
| 556 | const io = self.io; | 556 | const io = self.io; |
| 557 | | 557 | |
| 558 | if (self.resolved_include_paths) |include_paths| | 558 | if (self.resolved_include_paths == null) { |
| 559 | return include_paths; | 559 | self.resolved_include_paths = getIncludePaths( |
| 560 | | 560 | self.arena, |
| 561 | return getIncludePaths( | 561 | io, |
| 562 | self.arena, | 562 | self.auto_includes_option, |
| 563 | io, | 563 | self.zig_lib_dir, |
| 564 | self.auto_includes_option, | 564 | self.target_machine_type, |
| 565 | self.zig_lib_dir, | 565 | environ_map, |
| 566 | self.target_machine_type, | 566 | ) catch |err| switch (err) { |
| 567 | environ_map, | 567 | error.OutOfMemory => |e| return e, |
| 568 | ) catch |err| switch (err) { | 568 | else => |e| { |
| 569 | error.OutOfMemory => |e| return e, | 569 | switch (e) { |
| 570 | else => |e| { | 570 | error.UnsupportedAutoIncludesMachineType => { |
| 571 | switch (e) { | 571 | try error_handler.emitMessage(self.arena, io, .err, "automatic include path detection is not supported for target '{s}'", .{@tagName(self.target_machine_type)}); |
| 572 | error.UnsupportedAutoIncludesMachineType => { | 572 | }, |
| 573 | try error_handler.emitMessage(self.arena, io, .err, "automatic include path detection is not supported for target '{s}'", .{@tagName(self.target_machine_type)}); | 573 | error.MsvcIncludesNotFound => { |
| 574 | }, | 574 | try error_handler.emitMessage(self.arena, io, .err, "MSVC include paths could not be automatically detected", .{}); |
| 575 | error.MsvcIncludesNotFound => { | 575 | }, |
| 576 | try error_handler.emitMessage(self.arena, io, .err, "MSVC include paths could not be automatically detected", .{}); | 576 | error.MingwIncludesNotFound => { |
| 577 | }, | 577 | try error_handler.emitMessage(self.arena, io, .err, "MinGW include paths could not be automatically detected", .{}); |
| 578 | error.MingwIncludesNotFound => { | 578 | }, |
| 579 | try error_handler.emitMessage(self.arena, io, .err, "MinGW include paths could not be automatically detected", .{}); | 579 | } |
| 580 | }, | 580 | try error_handler.emitMessage(self.arena, io, .note, "to disable auto includes, use the option /:auto-includes none", .{}); |
| 581 | } | 581 | std.process.exit(1); |
| 582 | try error_handler.emitMessage(self.arena, io, .note, "to disable auto includes, use the option /:auto-includes none", .{}); | 582 | }, |
| 583 | std.process.exit(1); | 583 | }; |
| 584 | }, | 584 | } |
| 585 | }; | 585 | |
| | 586 | return self.resolved_include_paths.?; |
| 586 | } | 587 | } |
| 587 | }; | 588 | }; |
| 588 | | 589 | |