From a7bd016d01f44312041a6a91c960d11597eb7f80 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 24 Apr 2026 10:08:45 -0700 Subject: [PATCH] build: cleaner comments --- src/build/GhosttyZig.zig | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/build/GhosttyZig.zig b/src/build/GhosttyZig.zig index 5a15775c1..80a089968 100644 --- a/src/build/GhosttyZig.zig +++ b/src/build/GhosttyZig.zig @@ -124,7 +124,18 @@ fn initVt( // no-libc modes so we don't need libc or libcpp. System-provided // simdutf requires both libc and libcpp at runtime. .link_libc = if (system_simdutf) true else if (cfg.emit_lib_vt) false else null, - .link_libcpp = if (system_simdutf and cfg.target.result.abi != .msvc) true else if (cfg.emit_lib_vt and cfg.target.result.abi != .msvc) false else null, + .link_libcpp = libcpp: { + // MSVC is tightly coupled with the C++ standard library, so we + // need to link it even if we don't use it directly. + if (cfg.target.result.abi == .msvc) break :libcpp null; + + // System provided simdutf always requires libcpp because + // we can't specify the macro required during build to disable + // it. + if (system_simdutf) break :libcpp true; + + break :libcpp if (cfg.emit_lib_vt) false else null; + }, }); vt.addOptions("build_options", general_options); vt_options.add(b, vt);