diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-02-18 00:10:31 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-18 00:10:31 -0500 |
| commit | 3e586264e5295be87f13c34904ff9b61a95ded16 (patch) | |
| tree | 4f20f7fab5d7a4f754c65c6034240a5396b98a24 /src/analyze.cpp | |
| parent | 39207fa1d46ccaf55de80e1afd89fbccca6a73e7 (diff) | |
| parent | b93405c24bd3c58f68a272f32fe764a994e7aae6 (diff) | |
| download | zig-3e586264e5295be87f13c34904ff9b61a95ded16.tar.gz zig-3e586264e5295be87f13c34904ff9b61a95ded16.zip | |
Merge pull request #1972 from coypoop/netbsd
Add NetBSD support
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index 9941104bc4..37c0041314 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -4732,7 +4732,8 @@ void find_libc_include_path(CodeGen *g) { } } else if (g->zig_target.os == OsLinux || g->zig_target.os == OsMacOSX || - g->zig_target.os == OsFreeBSD) + g->zig_target.os == OsFreeBSD || + g->zig_target.os == OsNetBSD) { g->libc_include_dir = get_posix_libc_include_path(); } else { @@ -4781,7 +4782,7 @@ void find_libc_lib_path(CodeGen *g) { } else if (g->zig_target.os == OsLinux) { g->libc_lib_dir = get_linux_libc_lib_path("crt1.o"); - } else if (g->zig_target.os == OsFreeBSD) { + } else if ((g->zig_target.os == OsFreeBSD) || (g->zig_target.os == OsNetBSD)) { g->libc_lib_dir = buf_create_from_str("/usr/lib"); } else { zig_panic("Unable to determine libc lib path."); @@ -4795,7 +4796,7 @@ void find_libc_lib_path(CodeGen *g) { return; } else if (g->zig_target.os == OsLinux) { g->libc_static_lib_dir = get_linux_libc_lib_path("crtbegin.o"); - } else if (g->zig_target.os == OsFreeBSD) { + } else if ((g->zig_target.os == OsFreeBSD) || (g->zig_target.os == OsNetBSD)) { g->libc_static_lib_dir = buf_create_from_str("/usr/lib"); } else { zig_panic("Unable to determine libc static lib path."); @@ -6710,7 +6711,9 @@ LinkLib *add_link_lib(CodeGen *g, Buf *name) { if (is_libc && g->libc_link_lib != nullptr) return g->libc_link_lib; - if (g->enable_cache && is_libc && g->zig_target.os != OsMacOSX && g->zig_target.os != OsIOS && g->zig_target.os != OsFreeBSD) { + if (g->enable_cache && is_libc && g->zig_target.os != OsMacOSX && + g->zig_target.os != OsIOS && g->zig_target.os != OsFreeBSD && + g->zig_target.os != OsNetBSD) { fprintf(stderr, "TODO linking against libc is currently incompatible with `--cache on`.\n" "Zig is not yet capable of determining whether the libc installation has changed on subsequent builds.\n"); exit(1); |
