diff options
| author | Takeshi Yoneda <takeshi@tetrate.io> | 2021-06-14 17:48:01 +0900 |
|---|---|---|
| committer | Takeshi Yoneda <takeshi@tetrate.io> | 2021-06-14 17:48:01 +0900 |
| commit | 827fa4d837accc197df730f4a011c7c8a97202d1 (patch) | |
| tree | 28ca8a88dc6cf2b451a1df21bc9b1b76aee32d74 | |
| parent | 86ebd4b975d2f1e01f468e06daab6e28c06f9719 (diff) | |
| download | zig-827fa4d837accc197df730f4a011c7c8a97202d1.tar.gz zig-827fa4d837accc197df730f4a011c7c8a97202d1.zip | |
c++,wasi: enable libcxx build.
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
| -rw-r--r-- | src/libcxx.zig | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/libcxx.zig b/src/libcxx.zig index 16fad9f498..c2ac2ff32f 100644 --- a/src/libcxx.zig +++ b/src/libcxx.zig @@ -113,11 +113,13 @@ pub fn buildLibCXX(comp: *Compilation) !void { for (libcxx_files) |cxx_src| { var cflags = std.ArrayList([]const u8).init(arena); - if (target.os.tag == .windows) { - // Filesystem stuff isn't supported on Windows. + if (target.os.tag == .windows or target.os.tag == .wasi) { + // Filesystem stuff isn't supported on Windows and WASI. if (std.mem.startsWith(u8, cxx_src, "src/filesystem/")) continue; - } else { + } + + if (target.os.tag != .windows) { if (std.mem.startsWith(u8, cxx_src, "src/support/win32/")) continue; } @@ -133,7 +135,7 @@ pub fn buildLibCXX(comp: *Compilation) !void { try cflags.append("-fvisibility=hidden"); try cflags.append("-fvisibility-inlines-hidden"); - if (target.abi.isMusl()) { + if (target.abi.isMusl() or target.os.tag == .wasi) { try cflags.append("-D_LIBCPP_HAS_MUSL_LIBC"); } @@ -252,7 +254,7 @@ pub fn buildLibCXXABI(comp: *Compilation) !void { try cflags.append("-fvisibility=hidden"); try cflags.append("-fvisibility-inlines-hidden"); - if (target.abi.isMusl()) { + if (target.abi.isMusl() or target.os.tag == .wasi) { try cflags.append("-D_LIBCPP_HAS_MUSL_LIBC"); } |
