mirror of
https://github.com/ziglang/zig.git
synced 2025-12-27 16:43:07 +00:00
c++,wasi: enable libcxx build.
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
This commit is contained in:
parent
86ebd4b975
commit
827fa4d837
@ -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");
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user