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 {...@@ -673,6 +673,7 @@ pub const Builder = struct {
673 }673 }
674674
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),