Skip to content

Commit

Permalink
Merge pull request git-for-windows#1304 from jeffhostetler/vs2017_vcpkg
Browse files Browse the repository at this point in the history
VS2017 vcpkg support.
  • Loading branch information
dscho authored and jamill committed Sep 10, 2018
2 parents 2398f2d + 0607d53 commit a755078
Show file tree
Hide file tree
Showing 18 changed files with 506 additions and 563 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*.pm eol=lf diff=perl
*.png binary
*.py eol=lf diff=python
*.bat eol=crlf
/Documentation/git-*.txt eol=lf
/command-list.txt eol=lf
/GIT-VERSION-GEN eol=lf
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/GIT-BUILD-OPTIONS
/GIT-CFLAGS
/GIT-LDFLAGS
/GIT-MSVC-GEN
/GIT-PREFIX
/GIT-PERL-DEFINES
/GIT-PERL-HEADER
Expand Down
6 changes: 0 additions & 6 deletions .nuget/NuGet.config

This file was deleted.

20 changes: 14 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2604,9 +2604,6 @@ ifdef GIT_INTEROP_MAKE_OPTS
endif
ifdef TEST_GIT_INDEX_VERSION
@echo TEST_GIT_INDEX_VERSION=\''$(subst ','\'',$(subst ','\'',$(TEST_GIT_INDEX_VERSION)))'\' >>$@+
endif
ifdef MSVC_DEPS
@echo MSVC_DEPS=\''$(subst ','\'',$(subst ','\'',$(MSVC_DEPS)))'\' >>$@+
endif
@if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi

Expand Down Expand Up @@ -2756,8 +2753,6 @@ install: all
$(INSTALL) -m 644 $(SCRIPT_LIB) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
$(INSTALL) $(install_bindir_programs) '$(DESTDIR_SQ)$(bindir_SQ)'
ifdef MSVC
$(INSTALL) compat/vcbuild/GEN.DEPS/bin/*.dll '$(DESTDIR_SQ)$(bindir_SQ)'
$(INSTALL) compat/vcbuild/GEN.DEPS/bin/*.pdb '$(DESTDIR_SQ)$(bindir_SQ)'
# We DO NOT install the individual foo.o.pdb files because they
# have already been rolled up into the exe's pdb file.
# We DO NOT have pdb files for the builtin commands (like git-status.exe)
Expand All @@ -2776,6 +2771,13 @@ ifdef MSVC
$(INSTALL) git-remote-testsvn.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
$(INSTALL) git-sh-i18n--envsubst.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
$(INSTALL) git-show-index.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
ifndef DEBUG
$(INSTALL) $(vcpkg_rel_bin)/*.dll '$(DESTDIR_SQ)$(bindir_SQ)'
$(INSTALL) $(vcpkg_rel_bin)/*.pdb '$(DESTDIR_SQ)$(bindir_SQ)'
else
$(INSTALL) $(vcpkg_dbg_bin)/*.dll '$(DESTDIR_SQ)$(bindir_SQ)'
$(INSTALL) $(vcpkg_dbg_bin)/*.pdb '$(DESTDIR_SQ)$(bindir_SQ)'
endif
endif
$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(mergetools_instdir_SQ)'
Expand Down Expand Up @@ -2980,9 +2982,15 @@ endif
ifdef MSVC
$(RM) $(patsubst %.o,%.o.pdb,$(OBJECTS))
$(RM) $(patsubst %.exe,%.pdb,$(OTHER_PROGRAMS))
$(RM) $(patsubst %.exe,%.iobj,$(OTHER_PROGRAMS))
$(RM) $(patsubst %.exe,%.ipdb,$(OTHER_PROGRAMS))
$(RM) $(patsubst %.exe,%.pdb,$(PROGRAMS))
$(RM) $(patsubst %.exe,%.iobj,$(PROGRAMS))
$(RM) $(patsubst %.exe,%.ipdb,$(PROGRAMS))
$(RM) $(patsubst %.exe,%.pdb,$(TEST_PROGRAMS))
$(RM) GIT-MSVC-GEN
$(RM) $(patsubst %.exe,%.iobj,$(TEST_PROGRAMS))
$(RM) $(patsubst %.exe,%.ipdb,$(TEST_PROGRAMS))
$(RM) compat/vcbuild/MSVC-DEFS-GEN
endif

.PHONY: all install profile-clean cocciclean clean strip
Expand Down
4 changes: 3 additions & 1 deletion compat/vcbuild/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
GEN.*
/vcpkg/
/MSVC-DEFS-GEN
/VCPKG-DEFS
147 changes: 0 additions & 147 deletions compat/vcbuild/Makefile

This file was deleted.

51 changes: 51 additions & 0 deletions compat/vcbuild/README
Original file line number Diff line number Diff line change
@@ -1,3 +1,54 @@
The Steps to Build Git with VS2015 or VS2017 from the command line.

1. Install the "vcpkg" open source package manager and build essential
third-party libaries. The steps for this have been captured in a
set of convenience scripts. These can be run from a stock Command
Prompt or from an SDK bash window:

$ cd <repo_root>
$ ./compat/vcbuild/vcpkg_install.bat

The vcpkg tools and all of the third-party sources will be installed
in this folder:
<repo_root>/compat/vcbuild/vcpkg/

A file will be created with a set of Makefile macros pointing to a
unified "include", "lib", and "bin" directory (release and debug) for
all of the required packages. This file will be included by the main
Makefile:
<repo_root>/compat/vcbuild/MSVC-DEFS-GEN

2. OPTIONALLY copy the third-party *.dll and *.pdb files into the repo
root to make it easier to run and debug git.exe without having to
manipulate your PATH. This is especially true for debug sessions in
Visual Studio.

Use ONE of the following forms which should match how you want to
compile git.exe.

$ ./compat/vcbuild/vcpkg_copy_packages.bat debug
$ ./compat/vcbuild/vcpkg_copy_packages.bat release

3. Build git using MSVC from an SDK bash window using one of the
following commands:

$ make MSVC=1
$ make MSVC=1 DEBUG=1

================================================================

Alternatively, run `make MSVC=1 vcxproj` and then load the generated
git.sln in Visual Studio. The initial build will install the vcpkg
system and build the dependencies automatically. This will take a while.

Note that this will automatically add and commit the generated
.sln and .vcxproj files to the repo. You may want to drop this
commit before submitting a Pull Request....

Or maybe we should put the .sln/.vcxproj files in the .gitignores
and not do this. I'm not sure.

================================================================
The Steps of Build Git with VS2008

1. You need the build environment, which contains the Git dependencies
Expand Down
54 changes: 0 additions & 54 deletions compat/vcbuild/README_VS2015.txt

This file was deleted.

Loading

0 comments on commit a755078

Please sign in to comment.