Back to Ponyc

MSVC toolchain discovery (`vcvars.c`) feeds both the linker and the C-shim compiler

.known-couplings/msvc-vcvars.md

0.66.0951 B
Original Source

MSVC toolchain discovery (vcvars.c) feeds both the linker and the C-shim compiler

vcvars_get (src/libponyc/platform/vcvars.c) discovers the MSVC + Windows SDK toolchain. It's consumed in two places that must agree: the COFF linker (genexe.cc link_exe_lld_coff) reads the lib dirs (msvcrt/ucrt/kernel32), and the C-shim compiler (gencshim.cc add_system_include_args) reads the include dirs (msvc_include/ucrt_include/shared_include/um_include) and msvc_version, which find_kernel32/find_executables derive as siblings of the lib dirs. vcvars.c has no local unit tests, so a change to how it populates these fields surfaces only in the Windows CShimTest/c-shim* full-program tests (shim include resolution) and the link step — not in any test "local" to vcvars.c. Keep the lib-dir and include-dir derivations in step. Run on a Windows host: make test (CShimTest + the c-shim* full-program tests).