authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-12-12 16:40:04-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-12-12 16:40:04-05:00
logcdaa735b2bfe969874691302e4c5fe015e08cf8c
tree3e33a9453a1c018013a8910f72b17a3a07b6a435
parent2b9302107fdd4adbbcfc2735afd7f2e4cd4c6769

self-hosted: build tries to find llvm-config.exe


1 files changed, 5 insertions(+), 4 deletions(-)

std/build.zig+5-4
......@@ -673,6 +673,7 @@ 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)) {
......@@ -680,7 +681,7 @@ pub const Builder = struct {
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),