| ... | @@ -673,6 +673,7 @@ pub const Builder = struct { | ... | @@ -673,6 +673,7 @@ pub const Builder = struct { |
| 673 | } | 673 | } |
| 674 | | 674 | |
| 675 | pub fn findProgram(self: &Builder, names: []const []const u8, paths: []const []const u8) -> %[]const u8 { | 675 | pub fn findProgram(self: &Builder, names: []const []const u8, paths: []const []const u8) -> %[]const u8 { |
| | 676 | const exe_extension = (Target { .Native = {}}).exeFileExt(); |
| 676 | if (self.env_map.get("PATH")) |PATH| { | 677 | if (self.env_map.get("PATH")) |PATH| { |
| 677 | for (names) |name| { | 678 | for (names) |name| { |
| 678 | if (os.path.isAbsolute(name)) { | 679 | if (os.path.isAbsolute(name)) { |
| ... | @@ -680,7 +681,7 @@ pub const Builder = struct { | ... | @@ -680,7 +681,7 @@ pub const Builder = struct { |
| 680 | } | 681 | } |
| 681 | var it = mem.split(PATH, []u8{os.path.delimiter}); | 682 | var it = mem.split(PATH, []u8{os.path.delimiter}); |
| 682 | while (it.next()) |path| { | 683 | while (it.next()) |path| { |
| 683 | const full_path = %return os.path.join(self.allocator, path, name); | 684 | const full_path = %return os.path.join(self.allocator, path, self.fmt("{}{}", name, exe_extension)); |
| 684 | if (os.path.real(self.allocator, full_path)) |real_path| { | 685 | if (os.path.real(self.allocator, full_path)) |real_path| { |
| 685 | return real_path; | 686 | return real_path; |
| 686 | } else |_| { | 687 | } else |_| { |
| ... | @@ -694,7 +695,7 @@ pub const Builder = struct { | ... | @@ -694,7 +695,7 @@ pub const Builder = struct { |
| 694 | return name; | 695 | return name; |
| 695 | } | 696 | } |
| 696 | for (paths) |path| { | 697 | for (paths) |path| { |
| 697 | const full_path = %return os.path.join(self.allocator, path, name); | 698 | const full_path = %return os.path.join(self.allocator, path, self.fmt("{}{}", name, exe_extension)); |
| 698 | if (os.path.real(self.allocator, full_path)) |real_path| { | 699 | if (os.path.real(self.allocator, full_path)) |real_path| { |
| 699 | return real_path; | 700 | return real_path; |
| 700 | } else |_| { | 701 | } else |_| { |
| ... | @@ -902,7 +903,7 @@ pub const LibExeObjStep = struct { | ... | @@ -902,7 +903,7 @@ pub const LibExeObjStep = struct { |
| 902 | .kind = kind, | 903 | .kind = kind, |
| 903 | .root_src = root_src, | 904 | .root_src = root_src, |
| 904 | .name = name, | 905 | .name = name, |
| 905 | .target = Target { .Native = {} }, | 906 | .target = Target.Native, |
| 906 | .linker_script = null, | 907 | .linker_script = null, |
| 907 | .link_libs = BufSet.init(builder.allocator), | 908 | .link_libs = BufSet.init(builder.allocator), |
| 908 | .frameworks = BufSet.init(builder.allocator), | 909 | .frameworks = BufSet.init(builder.allocator), |
| ... | @@ -938,7 +939,7 @@ pub const LibExeObjStep = struct { | ... | @@ -938,7 +939,7 @@ pub const LibExeObjStep = struct { |
| 938 | .kind = kind, | 939 | .kind = kind, |
| 939 | .version = *version, | 940 | .version = *version, |
| 940 | .static = static, | 941 | .static = static, |
| 941 | .target = Target { .Native = {} }, | 942 | .target = Target.Native, |
| 942 | .cflags = ArrayList([]const u8).init(builder.allocator), | 943 | .cflags = ArrayList([]const u8).init(builder.allocator), |
| 943 | .source_files = ArrayList([]const u8).init(builder.allocator), | 944 | .source_files = ArrayList([]const u8).init(builder.allocator), |
| 944 | .object_files = ArrayList([]const u8).init(builder.allocator), | 945 | .object_files = ArrayList([]const u8).init(builder.allocator), |