Skip to content

Commit 289d256

Browse files
committed
Merge pull request #1304 from jeffhostetler/vs2017_vcpkg
VS2017 vcpkg support.
2 parents 0fa8a74 + d2971a9 commit 289d256

18 files changed

+344
-398
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*.pl eof=lf diff=perl
66
*.pm eol=lf diff=perl
77
*.py eol=lf diff=python
8+
*.bat eol=crlf
89
/Documentation/git-*.txt eol=lf
910
/command-list.txt eol=lf
1011
/GIT-VERSION-GEN eol=lf

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/GIT-BUILD-OPTIONS
22
/GIT-CFLAGS
33
/GIT-LDFLAGS
4-
/GIT-MSVC-GEN
54
/GIT-PREFIX
65
/GIT-PERL-DEFINES
76
/GIT-PERL-HEADER

.nuget/NuGet.config

Lines changed: 0 additions & 6 deletions
This file was deleted.

Makefile

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2602,9 +2602,6 @@ ifdef GIT_INTEROP_MAKE_OPTS
26022602
endif
26032603
ifdef TEST_GIT_INDEX_VERSION
26042604
@echo TEST_GIT_INDEX_VERSION=\''$(subst ','\'',$(subst ','\'',$(TEST_GIT_INDEX_VERSION)))'\' >>$@+
2605-
endif
2606-
ifdef MSVC_DEPS
2607-
@echo MSVC_DEPS=\''$(subst ','\'',$(subst ','\'',$(MSVC_DEPS)))'\' >>$@+
26082605
endif
26092606
@if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi
26102607

@@ -2754,8 +2751,6 @@ install: all
27542751
$(INSTALL) -m 644 $(SCRIPT_LIB) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
27552752
$(INSTALL) $(install_bindir_programs) '$(DESTDIR_SQ)$(bindir_SQ)'
27562753
ifdef MSVC
2757-
$(INSTALL) compat/vcbuild/GEN.DEPS/bin/*.dll '$(DESTDIR_SQ)$(bindir_SQ)'
2758-
$(INSTALL) compat/vcbuild/GEN.DEPS/bin/*.pdb '$(DESTDIR_SQ)$(bindir_SQ)'
27592754
# We DO NOT install the individual foo.o.pdb files because they
27602755
# have already been rolled up into the exe's pdb file.
27612756
# We DO NOT have pdb files for the builtin commands (like git-status.exe)
@@ -2774,6 +2769,13 @@ ifdef MSVC
27742769
$(INSTALL) git-remote-testsvn.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
27752770
$(INSTALL) git-sh-i18n--envsubst.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
27762771
$(INSTALL) git-show-index.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
2772+
ifndef DEBUG
2773+
$(INSTALL) $(vcpkg_rel_bin)/*.dll '$(DESTDIR_SQ)$(bindir_SQ)'
2774+
$(INSTALL) $(vcpkg_rel_bin)/*.pdb '$(DESTDIR_SQ)$(bindir_SQ)'
2775+
else
2776+
$(INSTALL) $(vcpkg_dbg_bin)/*.dll '$(DESTDIR_SQ)$(bindir_SQ)'
2777+
$(INSTALL) $(vcpkg_dbg_bin)/*.pdb '$(DESTDIR_SQ)$(bindir_SQ)'
2778+
endif
27772779
endif
27782780
$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
27792781
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(mergetools_instdir_SQ)'
@@ -2978,9 +2980,15 @@ endif
29782980
ifdef MSVC
29792981
$(RM) $(patsubst %.o,%.o.pdb,$(OBJECTS))
29802982
$(RM) $(patsubst %.exe,%.pdb,$(OTHER_PROGRAMS))
2983+
$(RM) $(patsubst %.exe,%.iobj,$(OTHER_PROGRAMS))
2984+
$(RM) $(patsubst %.exe,%.ipdb,$(OTHER_PROGRAMS))
29812985
$(RM) $(patsubst %.exe,%.pdb,$(PROGRAMS))
2986+
$(RM) $(patsubst %.exe,%.iobj,$(PROGRAMS))
2987+
$(RM) $(patsubst %.exe,%.ipdb,$(PROGRAMS))
29822988
$(RM) $(patsubst %.exe,%.pdb,$(TEST_PROGRAMS))
2983-
$(RM) GIT-MSVC-GEN
2989+
$(RM) $(patsubst %.exe,%.iobj,$(TEST_PROGRAMS))
2990+
$(RM) $(patsubst %.exe,%.ipdb,$(TEST_PROGRAMS))
2991+
$(RM) compat/vcbuild/MSVC-DEFS-GEN
29842992
endif
29852993

29862994
.PHONY: all install profile-clean cocciclean clean strip

compat/vcbuild/.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
GEN.*
1+
/vcpkg/
2+
/MSVC-DEFS-GEN
3+
/VCPKG-DEFS

compat/vcbuild/Makefile

Lines changed: 0 additions & 147 deletions
This file was deleted.

compat/vcbuild/README

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,54 @@
1+
The Steps to Build Git with VS2015 or VS2017 from the command line.
2+
3+
1. Install the "vcpkg" open source package manager and build essential
4+
third-party libaries. The steps for this have been captured in a
5+
set of convenience scripts. These can be run from a stock Command
6+
Prompt or from an SDK bash window:
7+
8+
$ cd <repo_root>
9+
$ ./compat/vcbuild/vcpkg_install.bat
10+
11+
The vcpkg tools and all of the third-party sources will be installed
12+
in this folder:
13+
<repo_root>/compat/vcbuild/vcpkg/
14+
15+
A file will be created with a set of Makefile macros pointing to a
16+
unified "include", "lib", and "bin" directory (release and debug) for
17+
all of the required packages. This file will be included by the main
18+
Makefile:
19+
<repo_root>/compat/vcbuild/MSVC-DEFS-GEN
20+
21+
2. OPTIONALLY copy the third-party *.dll and *.pdb files into the repo
22+
root to make it easier to run and debug git.exe without having to
23+
manipulate your PATH. This is especially true for debug sessions in
24+
Visual Studio.
25+
26+
Use ONE of the following forms which should match how you want to
27+
compile git.exe.
28+
29+
$ ./compat/vcbuild/vcpkg_copy_packages.bat debug
30+
$ ./compat/vcbuild/vcpkg_copy_packages.bat release
31+
32+
3. Build git using MSVC from an SDK bash window using one of the
33+
following commands:
34+
35+
$ make MSVC=1
36+
$ make MSVC=1 DEBUG=1
37+
38+
================================================================
39+
40+
Alternatively, run `make MSVC=1 vcxproj` and then load the generated
41+
git.sln in Visual Studio. The initial build will install the vcpkg
42+
system and build the dependencies automatically. This will take a while.
43+
44+
Note that this will automatically add and commit the generated
45+
.sln and .vcxproj files to the repo. You may want to drop this
46+
commit before submitting a Pull Request....
47+
48+
Or maybe we should put the .sln/.vcxproj files in the .gitignores
49+
and not do this. I'm not sure.
50+
51+
================================================================
152
The Steps of Build Git with VS2008
253

354
1. You need the build environment, which contains the Git dependencies

compat/vcbuild/README_VS2015.txt

Lines changed: 0 additions & 54 deletions
This file was deleted.

compat/vcbuild/find_vs_env.bat

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ REM
2525
REM The output of this script should be written to a make "include
2626
REM file" and referenced by the top-level Makefile.
2727
REM
28-
REM See "config.mak.uname" (look for GIT-MSVC-GEN).
28+
REM See "config.mak.uname" (look for compat/vcbuild/MSVC-DEFS-GEN).
2929
REM ================================================================
3030
REM The provided command prompts are custom to each VS release and
3131
REM filled with lots of internal knowledge (such as Registry settings);
@@ -154,7 +154,9 @@ REM ================================================================
154154
REM Include DOS-style and BASH-style path for bin dir.
155155

156156
echo msvc_bin_dir=%msvc_bin_dir%
157-
echo msvc_bin_dir_msys=%msvc_bin_dir:C:=/C%
157+
SET X1=%msvc_bin_dir:C:=/C%
158+
SET X2=%X1:\=/%
159+
echo msvc_bin_dir_msys=%X2%
158160

159161
echo msvc_includes=%msvc_includes%
160162
echo msvc_libs=%msvc_libs%

compat/vcbuild/nuget.config

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)