| ... | @@ -113,11 +113,13 @@ pub fn buildLibCXX(comp: *Compilation) !void { | ... | @@ -113,11 +113,13 @@ pub fn buildLibCXX(comp: *Compilation) !void { |
| 113 | for (libcxx_files) |cxx_src| { | 113 | for (libcxx_files) |cxx_src| { |
| 114 | var cflags = std.ArrayList([]const u8).init(arena); | 114 | var cflags = std.ArrayList([]const u8).init(arena); |
| 115 | | 115 | |
| 116 | if (target.os.tag == .windows) { | 116 | if (target.os.tag == .windows or target.os.tag == .wasi) { |
| 117 | // Filesystem stuff isn't supported on Windows. | 117 | // Filesystem stuff isn't supported on Windows and WASI. |
| 118 | if (std.mem.startsWith(u8, cxx_src, "src/filesystem/")) | 118 | if (std.mem.startsWith(u8, cxx_src, "src/filesystem/")) |
| 119 | continue; | 119 | continue; |
| 120 | } else { | 120 | } |
| | 121 | |
| | 122 | if (target.os.tag != .windows) { |
| 121 | if (std.mem.startsWith(u8, cxx_src, "src/support/win32/")) | 123 | if (std.mem.startsWith(u8, cxx_src, "src/support/win32/")) |
| 122 | continue; | 124 | continue; |
| 123 | } | 125 | } |
| ... | @@ -133,7 +135,7 @@ pub fn buildLibCXX(comp: *Compilation) !void { | ... | @@ -133,7 +135,7 @@ pub fn buildLibCXX(comp: *Compilation) !void { |
| 133 | try cflags.append("-fvisibility=hidden"); | 135 | try cflags.append("-fvisibility=hidden"); |
| 134 | try cflags.append("-fvisibility-inlines-hidden"); | 136 | try cflags.append("-fvisibility-inlines-hidden"); |
| 135 | | 137 | |
| 136 | if (target.abi.isMusl()) { | 138 | if (target.abi.isMusl() or target.os.tag == .wasi) { |
| 137 | try cflags.append("-D_LIBCPP_HAS_MUSL_LIBC"); | 139 | try cflags.append("-D_LIBCPP_HAS_MUSL_LIBC"); |
| 138 | } | 140 | } |
| 139 | | 141 | |
| ... | @@ -252,7 +254,7 @@ pub fn buildLibCXXABI(comp: *Compilation) !void { | ... | @@ -252,7 +254,7 @@ pub fn buildLibCXXABI(comp: *Compilation) !void { |
| 252 | try cflags.append("-fvisibility=hidden"); | 254 | try cflags.append("-fvisibility=hidden"); |
| 253 | try cflags.append("-fvisibility-inlines-hidden"); | 255 | try cflags.append("-fvisibility-inlines-hidden"); |
| 254 | | 256 | |
| 255 | if (target.abi.isMusl()) { | 257 | if (target.abi.isMusl() or target.os.tag == .wasi) { |
| 256 | try cflags.append("-D_LIBCPP_HAS_MUSL_LIBC"); | 258 | try cflags.append("-D_LIBCPP_HAS_MUSL_LIBC"); |
| 257 | } | 259 | } |
| 258 | | 260 | |