authorgravatar for takeshi@tetrate.ioTakeshi Yoneda <takeshi@tetrate.io> 2021-06-14 17:48:01+09:00
committergravatar for takeshi@tetrate.ioTakeshi Yoneda <takeshi@tetrate.io> 2021-06-14 17:48:01+09:00
log827fa4d837accc197df730f4a011c7c8a97202d1
tree28ca8a88dc6cf2b451a1df21bc9b1b76aee32d74
parent86ebd4b975d2f1e01f468e06daab6e28c06f9719

c++,wasi: enable libcxx build.

Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>

1 files changed, 7 insertions(+), 5 deletions(-)

src/libcxx.zig+7-5
...@@ -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);
115115
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");
135137
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 }
139141
...@@ -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");
254256
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 }
258260