aboutsummaryrefslogtreecommitdiff
path: root/src-self-hosted
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-02-25 03:43:21 -0500
committerAndrew Kelley <andrew@ziglang.org>2020-02-28 14:51:54 -0500
commit87b9e744dda465ecf7663e2463066ea26a44e63a (patch)
treee3c09dca4b8a06656029b1034da24ed9b7507299 /src-self-hosted
parentd4f375c46be2e509ee9161b0577d8a25d6620b3e (diff)
downloadzig-87b9e744dda465ecf7663e2463066ea26a44e63a.tar.gz
zig-87b9e744dda465ecf7663e2463066ea26a44e63a.zip
update std lib to new Target API
Diffstat (limited to 'src-self-hosted')
-rw-r--r--src-self-hosted/libc_installation.zig14
1 files changed, 5 insertions, 9 deletions
diff --git a/src-self-hosted/libc_installation.zig b/src-self-hosted/libc_installation.zig
index d617abb821..41def38126 100644
--- a/src-self-hosted/libc_installation.zig
+++ b/src-self-hosted/libc_installation.zig
@@ -7,11 +7,7 @@ const Allocator = std.mem.Allocator;
const Batch = std.event.Batch;
const is_darwin = Target.current.isDarwin();
-const is_windows = Target.current.isWindows();
-const is_freebsd = Target.current.isFreeBSD();
-const is_netbsd = Target.current.isNetBSD();
-const is_linux = Target.current.isLinux();
-const is_dragonfly = Target.current.isDragonFlyBSD();
+const is_windows = Target.current.os.tag == .windows;
const is_gnu = Target.current.isGnu();
usingnamespace @import("windows_sdk.zig");
@@ -216,10 +212,10 @@ pub const LibCInstallation = struct {
var batch = Batch(FindError!void, 2, .auto_async).init();
errdefer batch.wait() catch {};
batch.add(&async self.findNativeIncludeDirPosix(args));
- if (is_freebsd or is_netbsd) {
- self.crt_dir = try std.mem.dupeZ(args.allocator, u8, "/usr/lib");
- } else if (is_linux or is_dragonfly) {
- batch.add(&async self.findNativeCrtDirPosix(args));
+ switch (Target.current.os.tag) {
+ .freebsd, .netbsd => self.crt_dir = try std.mem.dupeZ(args.allocator, u8, "/usr/lib"),
+ .linux, .dragonfly => batch.add(&async self.findNativeCrtDirPosix(args)),
+ else => {},
}
break :blk batch.wait();
};