Skip to content

Commit cdaa735

Browse files
committedDec 12, 2017
self-hosted: build tries to find llvm-config.exe
·
0.15.20.2.0
1 parent 2b93021 commit cdaa735

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

‎std/build.zig‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -673,14 +673,15 @@ pub const Builder = struct {
673673
}
674674

675675
pub fn findProgram(self: &Builder, names: []const []const u8, paths: []const []const u8) -> %[]const u8 {
676+
const exe_extension = (Target { .Native = {}}).exeFileExt();
676677
if (self.env_map.get("PATH")) |PATH| {
677678
for (names) |name| {
678679
if (os.path.isAbsolute(name)) {
679680
return name;
680681
}
681682
var it = mem.split(PATH, []u8{os.path.delimiter});
682683
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));
684685
if (os.path.real(self.allocator, full_path)) |real_path| {
685686
return real_path;
686687
} else |_| {
@@ -694,7 +695,7 @@ pub const Builder = struct {
694695
return name;
695696
}
696697
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));
698699
if (os.path.real(self.allocator, full_path)) |real_path| {
699700
return real_path;
700701
} else |_| {
@@ -902,7 +903,7 @@ pub const LibExeObjStep = struct {
902903
.kind = kind,
903904
.root_src = root_src,
904905
.name = name,
905-
.target = Target { .Native = {} },
906+
.target = Target.Native,
906907
.linker_script = null,
907908
.link_libs = BufSet.init(builder.allocator),
908909
.frameworks = BufSet.init(builder.allocator),
@@ -938,7 +939,7 @@ pub const LibExeObjStep = struct {
938939
.kind = kind,
939940
.version = *version,
940941
.static = static,
941-
.target = Target { .Native = {} },
942+
.target = Target.Native,
942943
.cflags = ArrayList([]const u8).init(builder.allocator),
943944
.source_files = ArrayList([]const u8).init(builder.allocator),
944945
.object_files = ArrayList([]const u8).init(builder.allocator),

0 commit comments

Comments
 (0)
Please sign in to comment.