meson: fix compat sources when compiling with MSVC

In our compat library we have both "msvc.c" and "mingw.c". The former is mostly a thin wrapper around the latter as it directly includes it, but it has a couple of extra headers that aren't included in "mingw.c" and is expected to be used with the Visual Studio compiler toolchain. While our Makefile knows to pick up the correct file depending on whether or not the Visual Studio toolchain is used, we don't do the same with Meson. Fix this. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Mar 20, 2025 at 11:37 UTC 871491f7ade026a198af054633ebfeecf23c44fe
1 file changed +3 -1
meson.build
+3 -1
@@ -1107,7 +1107,6 @@ if host_machine.system() == 'cygwin'
1107 ]
1108 elif host_machine.system() == 'windows'
1109 libgit_sources += [
1110 - 'compat/mingw.c',
1110 'compat/winansi.c',
1111 'compat/win32/dirent.c',
1112 'compat/win32/flush.c',
@@ -1134,6 +1133,9 @@ elif host_machine.system() == 'windows'
1133 libgit_include_directories += 'compat/win32'
1134 if compiler.get_id() == 'msvc'
1135 libgit_include_directories += 'compat/vcbuild/include'
1136 + libgit_sources += 'compat/msvc.c'
1137 + else
1138 + libgit_sources += 'compat/mingw.c'
1139 endif
1140 endif
1141