git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 1/2] meson: fix compat sources when compiling with MSVC

From
Patrick Steinhardt <ps@pks.im>
Date
Mar 20, 2025, 10:37 UTC
Message-ID
<20250320-b4-pks-mingw-lockfile-flake-v2-1-a84c90cfc6c2@pks.im>
In-Reply-To
<20250320-b4-pks-mingw-lockfile-flake-v2-0-a84c90cfc6c2@pks.im>

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>
---
 meson.build | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index efe2871c9db..2cf9da3474b 100644
--- a/meson.build
+++ b/meson.build
@@ -1107,7 +1107,6 @@ if host_machine.system() == 'cygwin'
   ]
 elif host_machine.system() == 'windows'
   libgit_sources += [
-    'compat/mingw.c',
     'compat/winansi.c',
     'compat/win32/dirent.c',
     'compat/win32/flush.c',
@@ -1134,6 +1133,9 @@ elif host_machine.system() == 'windows'
   libgit_include_directories += 'compat/win32'
   if compiler.get_id() == 'msvc'
     libgit_include_directories += 'compat/vcbuild/include'
+    libgit_sources += 'compat/msvc.c'
+  else
+    libgit_sources += 'compat/mingw.c'
   endif
 endif
 
-- 
2.49.0.472.ge94155a9ec.dirty
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 9 of 14 in “compat/mingw: fix EACCESS when opening files with `O_CREAT | O_EXCL`”
  1. 0/2 compat/mingw: fix EACCESS when opening files with `O_CREAT | O_EXCL`Patrick Steinhardt, Mar 13, 2025
  2. 2/2 compat/mingw: fix EACCESS when opening files with `O_CREAT | O_EXCL`Patrick Steinhardt, Mar 13, 2025
  3. Junio C HamanoMar 13, 2025
  4. Johannes SchindelinMar 16, 2025
  5. Patrick SteinhardtMar 17, 2025
  6. 1/2 compat/mingw: handle O_CLOEXEC in `mingw_open_existing()`Patrick Steinhardt, Mar 13, 2025
  7. Junio C HamanoMar 13, 2025
  8. 0/2 compat/mingw: fix EACCESS when opening files with `O_CREAT | O_EXCL`Patrick Steinhardt, Mar 20, 2025
  9. 1/2 meson: fix compat sources when compiling with MSVCPatrick Steinhardt, Mar 20, 2025
  10. 2/2 compat/mingw: fix EACCESS when opening files with `O_CREAT | O_EXCL`Patrick Steinhardt, Mar 20, 2025
  11. Johannes SchindelinMar 26, 2025
  12. Patrick SteinhardtMar 28, 2025
  13. Johannes SchindelinMar 28, 2025
  14. Patrick SteinhardtMar 31, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.