Skip to content

Commit 8b65122

Browse files
jeffhostetlerdscho
authored andcommitted
Merge branch 'visual-studio'
Signed-off-by: Johannes Schindelin <[email protected]>
2 parents fc291ee + 1821d8c commit 8b65122

File tree

10 files changed

+615
-97
lines changed

10 files changed

+615
-97
lines changed

.gitignore

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,42 @@
190190
/gitweb/static/gitweb.js
191191
/gitweb/static/gitweb.min.*
192192
/command-list.h
193+
/libgit
194+
/test-chmtime
195+
/test-ctype
196+
/test-config
197+
/test-date
198+
/test-delta
199+
/test-dump-cache-tree
200+
/test-dump-split-index
201+
/test-dump-untracked-cache
202+
/test-fake-ssh
203+
/test-scrap-cache-tree
204+
/test-genrandom
205+
/test-hashmap
206+
/test-index-version
207+
/test-line-buffer
208+
/test-match-trees
209+
/test-mergesort
210+
/test-mktemp
211+
/test-parse-options
212+
/test-path-utils
213+
/test-prio-queue
214+
/test-read-cache
215+
/test-regex
216+
/test-revision-walking
217+
/test-run-command
218+
/test-sha1
219+
/test-sha1-array
220+
/test-sigchain
221+
/test-string-list
222+
/test-submodule-config
223+
/test-subprocess
224+
/test-svn-fe
225+
/test-urlmatch-normalization
226+
/test-wildmatch
227+
/vcs-svn_lib
228+
/xdiff_lib
193229
*.tar.gz
194230
*.dsc
195231
*.deb
@@ -232,6 +268,10 @@
232268
*.ipdb
233269
*.dll
234270
.vs/
235-
/Debug/
236-
/Release/
271+
*.manifest
272+
Debug/
273+
Release/
274+
/UpgradeLog*.htm
275+
/git.VC.VC.opendb
276+
/git.VC.db
237277
*.dSYM

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2692,7 +2692,7 @@ bin-wrappers/%: wrap-for-bin.sh
26922692
@mkdir -p bin-wrappers
26932693
$(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
26942694
-e 's|@@BUILD_DIR@@|$(shell pwd)|' \
2695-
-e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%,$(@F))|' < $< > $@ && \
2695+
-e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%$(X),$(@F))$(patsubst git%,$(X),$(filter $(@F),$(BINDIR_PROGRAMS_NEED_X)))|' < $< > $@ && \
26962696
chmod +x $@
26972697

26982698
# GNU make supports exporting all variables by "export" without parameters.

config.mak.uname

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ include compat/vcbuild/MSVC-DEFS-GEN
2525
# See if vcpkg and the vcpkg-build versions of the third-party
2626
# libraries that we use are installed. We include the result
2727
# to get $(vcpkg_*) variables defined for the Makefile.
28+
ifeq (,$(SKIP_VCPKG))
2829
compat/vcbuild/VCPKG-DEFS: compat/vcbuild/vcpkg_install.bat
2930
@"$<"
3031
include compat/vcbuild/VCPKG-DEFS
3132
endif
33+
endif
3234

3335
# We choose to avoid "if .. else if .. else .. endif endif"
3436
# because maintaining the nesting to match is a pain. If
@@ -680,3 +682,77 @@ ifeq ($(uname_S),QNX)
680682
NO_STRCASESTR = YesPlease
681683
NO_STRLCPY = YesPlease
682684
endif
685+
686+
vcxproj:
687+
# Require clean work tree
688+
git update-index -q --refresh && \
689+
git diff-files --quiet && \
690+
git diff-index --cached --quiet HEAD --
691+
692+
# Make .vcxproj files and add them
693+
unset QUIET_GEN QUIET_BUILT_IN; \
694+
perl contrib/buildsystems/generate -g Vcxproj
695+
git add -f git.sln {*,*/lib,t/helper/*}/*.vcxproj
696+
697+
# Generate the LinkOrCopyBuiltins.targets file
698+
(echo '<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">' && \
699+
echo ' <Target Name="CopyBuiltins_AfterBuild" AfterTargets="AfterBuild">' && \
700+
for name in $(BUILT_INS);\
701+
do \
702+
echo ' <Copy SourceFiles="$$(OutDir)\git.exe" DestinationFiles="$$(OutDir)\'"$$name"'" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" />'; \
703+
done && \
704+
for name in $(REMOTE_CURL_ALIASES); \
705+
do \
706+
echo ' <Copy SourceFiles="$$(OutDir)\'"$(REMOTE_CURL_PRIMARY)"'" DestinationFiles="$$(OutDir)\'"$$name"'" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" />'; \
707+
done && \
708+
echo ' </Target>' && \
709+
echo '</Project>') >git/LinkOrCopyBuiltins.targets
710+
git add -f git/LinkOrCopyBuiltins.targets
711+
712+
# Add command-list.h
713+
$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 command-list.h
714+
git add -f command-list.h
715+
716+
# Add scripts
717+
rm -f perl/perl.mak
718+
$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 \
719+
$(SCRIPT_LIB) $(SCRIPT_SH_GEN) $(SCRIPT_PERL_GEN)
720+
# Strip out the sane tool path, needed only for building
721+
sed -i '/^git_broken_path_fix ".*/d' git-sh-setup
722+
git add -f $(SCRIPT_LIB) $(SCRIPT_SH_GEN) $(SCRIPT_PERL_GEN)
723+
724+
# Add Perl module
725+
$(MAKE) $(LIB_PERL_GEN)
726+
git add -f perl/build
727+
728+
# Add bin-wrappers, for testing
729+
rm -rf bin-wrappers/
730+
$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(test_bindir_programs)
731+
# Ensure that the GIT_EXEC_PATH is a Unix-y one, and that the absolute
732+
# path of the repository is not hard-coded (GIT_EXEC_PATH will be set
733+
# by test-lib.sh according to the current setup)
734+
sed -i -e 's/^\(GIT_EXEC_PATH\)=.*/test -n "$${\1##*:*}" ||\
735+
\1="$$(cygpath -u "$$\1")"/' \
736+
-e "s|'$$(pwd)|\"\$$GIT_EXEC_PATH\"'|g" bin-wrappers/*
737+
# Ensure that test-* helpers find the .dll files copied to top-level
738+
sed -i 's|^PATH=.*|&:"$$GIT_EXEC_PATH"|' bin-wrappers/test-*
739+
# We do not want to force hard-linking builtins
740+
sed -i 's|\(git\)-\([-a-z]*\)\.exe"|\1.exe" \2|g' \
741+
bin-wrappers/git-{receive-pack,upload-archive}
742+
git add -f $(test_bindir_programs)
743+
# remote-ext is a builtin, but invoked as if it were external
744+
sed 's|receive-pack|remote-ext|g' \
745+
<bin-wrappers/git-receive-pack >bin-wrappers/git-remote-ext
746+
git add -f bin-wrappers/git-remote-ext
747+
748+
# Add templates
749+
$(MAKE) -C templates
750+
git add -f templates/boilerplates.made templates/blt/
751+
752+
# Add build options
753+
$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 GIT-BUILD-OPTIONS
754+
git add -f GIT-BUILD-OPTIONS
755+
756+
# Commit the whole shebang
757+
git commit -m "Generate Visual Studio solution" \
758+
-m "Auto-generated by \`$(MAKE)$(MAKEFLAGS) $@\`"

contrib/buildsystems/Generators.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ BEGIN {
1717
$me = dirname($me);
1818
if (opendir(D,"$me/Generators")) {
1919
foreach my $gen (readdir(D)) {
20-
next if ($gen =~ /^\.\.?$/);
20+
next unless ($gen =~ /\.pm$/);
2121
require "${me}/Generators/$gen";
2222
$gen =~ s,\.pm,,;
2323
push(@AVAILABLE, $gen);

0 commit comments

Comments
 (0)