Commit 741445ce29

Andrew Kelley <andrew@ziglang.org>
2023-01-12 02:05:14
build.zig: use zig-provided libc++ by default on Windows
1 parent 4d306eb
Changed files (1)
build.zig
@@ -568,14 +568,14 @@ fn addCmakeCfgOptionsToExe(
                 // back to -lc++ and cross our fingers.
                 addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), "", need_cpp_includes) catch |err| switch (err) {
                     error.RequiredLibraryNotFound => {
-                        exe.linkSystemLibrary("c++");
+                        exe.linkLibCpp();
                     },
                     else => |e| return e,
                 };
                 exe.linkSystemLibrary("unwind");
             },
-            .ios, .macos, .watchos, .tvos => {
-                exe.linkSystemLibrary("c++");
+            .ios, .macos, .watchos, .tvos, .windows => {
+                exe.linkLibCpp();
             },
             .freebsd => {
                 if (static) {