diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-12-12 16:40:04 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-12-12 16:40:04 -0500 |
| commit | cdaa735b2bfe969874691302e4c5fe015e08cf8c (patch) | |
| tree | 3e33a9453a1c018013a8910f72b17a3a07b6a435 /std/build.zig | |
| parent | 2b9302107fdd4adbbcfc2735afd7f2e4cd4c6769 (diff) | |
| download | zig-cdaa735b2bfe969874691302e4c5fe015e08cf8c.tar.gz zig-cdaa735b2bfe969874691302e4c5fe015e08cf8c.zip | |
self-hosted: build tries to find llvm-config.exe
Diffstat (limited to 'std/build.zig')
| -rw-r--r-- | std/build.zig | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/std/build.zig b/std/build.zig index 63d635de70..c1c42a4bc1 100644 --- a/std/build.zig +++ b/std/build.zig @@ -673,6 +673,7 @@ pub const Builder = struct { } pub fn findProgram(self: &Builder, names: []const []const u8, paths: []const []const u8) -> %[]const u8 { + const exe_extension = (Target { .Native = {}}).exeFileExt(); if (self.env_map.get("PATH")) |PATH| { for (names) |name| { if (os.path.isAbsolute(name)) { @@ -680,7 +681,7 @@ pub const Builder = struct { } var it = mem.split(PATH, []u8{os.path.delimiter}); while (it.next()) |path| { - const full_path = %return os.path.join(self.allocator, path, name); + const full_path = %return os.path.join(self.allocator, path, self.fmt("{}{}", name, exe_extension)); if (os.path.real(self.allocator, full_path)) |real_path| { return real_path; } else |_| { @@ -694,7 +695,7 @@ pub const Builder = struct { return name; } for (paths) |path| { - const full_path = %return os.path.join(self.allocator, path, name); + const full_path = %return os.path.join(self.allocator, path, self.fmt("{}{}", name, exe_extension)); if (os.path.real(self.allocator, full_path)) |real_path| { return real_path; } else |_| { @@ -902,7 +903,7 @@ pub const LibExeObjStep = struct { .kind = kind, .root_src = root_src, .name = name, - .target = Target { .Native = {} }, + .target = Target.Native, .linker_script = null, .link_libs = BufSet.init(builder.allocator), .frameworks = BufSet.init(builder.allocator), @@ -938,7 +939,7 @@ pub const LibExeObjStep = struct { .kind = kind, .version = *version, .static = static, - .target = Target { .Native = {} }, + .target = Target.Native, .cflags = ArrayList([]const u8).init(builder.allocator), .source_files = ArrayList([]const u8).init(builder.allocator), .object_files = ArrayList([]const u8).init(builder.allocator), |
