Skip to content

Commit 31ddf16

Browse files
authored
Merge pull request libgit2#5512 from A-Ovchinnikov-mx/patch-1
README.md: Add instructions for building in MinGW environment
2 parents b83bc6d + 4ad3633 commit 31ddf16

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Table of Contents
4747
* [Compiler and linker options](#compiler-and-linker-options)
4848
* [MacOS X](#macos-x)
4949
* [Android](#android)
50+
* [MinGW](#mingw)
5051
* [Language Bindings](#language-bindings)
5152
* [How Can I Contribute?](#how-can-i-contribute)
5253
* [License](#license)
@@ -304,6 +305,20 @@ with full path to the toolchain):
304305
Add `-DCMAKE_TOOLCHAIN_FILE={pathToToolchainFile}` to cmake command
305306
when configuring.
306307

308+
MinGW
309+
-----
310+
311+
If you want to build the library in MinGW environment with SSH support enabled,
312+
you may need to pass `-DCMAKE_LIBRARY_PATH="${MINGW_PREFIX}/${MINGW_CHOST}/lib/"` flag
313+
to CMake when configuring. This is because CMake cannot find the Win32 libraries in
314+
MinGW folders by default and you might see an error message stating that CMake
315+
could not resolve `ws2_32` library during configuration.
316+
317+
Another option would be to install `msys2-w32api-runtime` package before configuring.
318+
This package installs the Win32 libraries into `/usr/lib` folder which is by default
319+
recognized as the library path by CMake. Please note though that this package is meant
320+
for MSYS subsystem which is different from MinGW.
321+
307322
Language Bindings
308323
==================================
309324

0 commit comments

Comments
 (0)