summaryrefslogtreecommitdiff
path: root/compat/mingw.c
diff options
context:
space:
mode:
authorJeff Hostetler <jeffhost@microsoft.com>2019-06-25 14:49:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-06-25 17:46:57 (GMT)
commitdce7d295514f0acebb897cc37a451963d60588f5 (patch)
treef4b6f4a0f6f23a5e362d6337c581ed8f5dd4192f /compat/mingw.c
parentc444bf8cb6a881f4c249e904a12e201dae40b7d2 (diff)
downloadgit-dce7d295514f0acebb897cc37a451963d60588f5.zip
git-dce7d295514f0acebb897cc37a451963d60588f5.tar.gz
git-dce7d295514f0acebb897cc37a451963d60588f5.tar.bz2
msvc: support building Git using MS Visual C++
With this patch, Git can be built using the Microsoft toolchain, via: make MSVC=1 [DEBUG=1] Third party libraries are built from source using the open source "vcpkg" tool set. See https://github.com/Microsoft/vcpkg On a first build, the vcpkg tools and the third party libraries are automatically downloaded and built. DLLs for the third party libraries are copied to the top-level (and t/helper) directory to facilitate debugging. See compat/vcbuild/README. A series of .bat files are invoked by the Makefile to find the location of the installed version of Visual Studio and the associated compiler tools (essentially replicating the environment setup performed by a "Developer Command Prompt"). This should find the most recent VS2015 or VS2017 installation. Output from these scripts are used by the Makefile to define compiler and linker pathnames and -I and -L arguments. The build produces .pdb files for both debug and release builds. Note: This commit was squashed from an organic series of commits developed between 2016 and 2018 in Git for Windows' `master` branch. This combined commit eliminates the obsolete commits related to fetching NuGet packages for third party libraries. It is difficult to use NuGet packages for C/C++ sources because they may be built by earlier versions of the MSVC compiler and have CRT version and linking issues. Additionally, the C/C++ NuGet packages that we were using tended to not be updated concurrently with the sources. And in the case of cURL and OpenSSL, this could expose us to security issues. Helped-by: Yue Lin Ho <b8732003@student.nsysu.edu.tw> Helped-by: Philip Oakley <philipoakley@iee.org> Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat/mingw.c')
-rw-r--r--compat/mingw.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index d14d333..c063ae6 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -2388,6 +2388,12 @@ static void maybe_redirect_std_handles(void)
GENERIC_WRITE, FILE_FLAG_NO_BUFFERING);
}
+#ifdef _MSC_VER
+#ifdef _DEBUG
+#include <crtdbg.h>
+#endif
+#endif
+
/*
* We implement wmain() and compile with -municode, which would
* normally ignore main(), but we call the latter from the former