Skip to content

Commit 8cf7cc7

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

File tree

10 files changed

+615
-97
lines changed

10 files changed

+615
-97
lines changed

.gitignore

+42-2
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,42 @@
185185
/gitweb/static/gitweb.js
186186
/gitweb/static/gitweb.min.*
187187
/command-list.h
188+
/libgit
189+
/test-chmtime
190+
/test-ctype
191+
/test-config
192+
/test-date
193+
/test-delta
194+
/test-dump-cache-tree
195+
/test-dump-split-index
196+
/test-dump-untracked-cache
197+
/test-fake-ssh
198+
/test-scrap-cache-tree
199+
/test-genrandom
200+
/test-hashmap
201+
/test-index-version
202+
/test-line-buffer
203+
/test-match-trees
204+
/test-mergesort
205+
/test-mktemp
206+
/test-parse-options
207+
/test-path-utils
208+
/test-prio-queue
209+
/test-read-cache
210+
/test-regex
211+
/test-revision-walking
212+
/test-run-command
213+
/test-sha1
214+
/test-sha1-array
215+
/test-sigchain
216+
/test-string-list
217+
/test-submodule-config
218+
/test-subprocess
219+
/test-svn-fe
220+
/test-urlmatch-normalization
221+
/test-wildmatch
222+
/vcs-svn_lib
223+
/xdiff_lib
188224
*.tar.gz
189225
*.dsc
190226
*.deb
@@ -227,5 +263,9 @@
227263
*.ipdb
228264
*.dll
229265
.vs/
230-
/Debug/
231-
/Release/
266+
*.manifest
267+
Debug/
268+
Release/
269+
/UpgradeLog*.htm
270+
/git.VC.VC.opendb
271+
/git.VC.db

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2625,7 +2625,7 @@ bin-wrappers/%: wrap-for-bin.sh
26252625
@mkdir -p bin-wrappers
26262626
$(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
26272627
-e 's|@@BUILD_DIR@@|$(shell pwd)|' \
2628-
-e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%,$(@F))|' < $< > $@ && \
2628+
-e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%$(X),$(@F))$(patsubst git%,$(X),$(filter $(@F),$(BINDIR_PROGRAMS_NEED_X)))|' < $< > $@ && \
26292629
chmod +x $@
26302630

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

config.mak.uname

+76
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
@@ -654,3 +656,77 @@ ifeq ($(uname_S),QNX)
654656
NO_STRCASESTR = YesPlease
655657
NO_STRLCPY = YesPlease
656658
endif
659+
660+
vcxproj:
661+
# Require clean work tree
662+
git update-index -q --refresh && \
663+
git diff-files --quiet && \
664+
git diff-index --cached --quiet HEAD --
665+
666+
# Make .vcxproj files and add them
667+
unset QUIET_GEN QUIET_BUILT_IN; \
668+
perl contrib/buildsystems/generate -g Vcxproj
669+
git add -f git.sln {*,*/lib,t/helper/*}/*.vcxproj
670+
671+
# Generate the LinkOrCopyBuiltins.targets file
672+
(echo '<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">' && \
673+
echo ' <Target Name="CopyBuiltins_AfterBuild" AfterTargets="AfterBuild">' && \
674+
for name in $(BUILT_INS);\
675+
do \
676+
echo ' <Copy SourceFiles="$$(OutDir)\git.exe" DestinationFiles="$$(OutDir)\'"$$name"'" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" />'; \
677+
done && \
678+
for name in $(REMOTE_CURL_ALIASES); \
679+
do \
680+
echo ' <Copy SourceFiles="$$(OutDir)\'"$(REMOTE_CURL_PRIMARY)"'" DestinationFiles="$$(OutDir)\'"$$name"'" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" />'; \
681+
done && \
682+
echo ' </Target>' && \
683+
echo '</Project>') >git/LinkOrCopyBuiltins.targets
684+
git add -f git/LinkOrCopyBuiltins.targets
685+
686+
# Add command-list.h
687+
$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 command-list.h
688+
git add -f command-list.h
689+
690+
# Add scripts
691+
rm -f perl/perl.mak
692+
$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 \
693+
$(SCRIPT_LIB) $(SCRIPT_SH_GEN) $(SCRIPT_PERL_GEN)
694+
# Strip out the sane tool path, needed only for building
695+
sed -i '/^git_broken_path_fix ".*/d' git-sh-setup
696+
git add -f $(SCRIPT_LIB) $(SCRIPT_SH_GEN) $(SCRIPT_PERL_GEN)
697+
698+
# Add Perl module
699+
$(MAKE) $(LIB_PERL_GEN)
700+
git add -f perl/build
701+
702+
# Add bin-wrappers, for testing
703+
rm -rf bin-wrappers/
704+
$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(test_bindir_programs)
705+
# Ensure that the GIT_EXEC_PATH is a Unix-y one, and that the absolute
706+
# path of the repository is not hard-coded (GIT_EXEC_PATH will be set
707+
# by test-lib.sh according to the current setup)
708+
sed -i -e 's/^\(GIT_EXEC_PATH\)=.*/test -n "$${\1##*:*}" ||\
709+
\1="$$(cygpath -u "$$\1")"/' \
710+
-e "s|'$$(pwd)|\"\$$GIT_EXEC_PATH\"'|g" bin-wrappers/*
711+
# Ensure that test-* helpers find the .dll files copied to top-level
712+
sed -i 's|^PATH=.*|&:"$$GIT_EXEC_PATH"|' bin-wrappers/test-*
713+
# We do not want to force hard-linking builtins
714+
sed -i 's|\(git\)-\([-a-z]*\)\.exe"|\1.exe" \2|g' \
715+
bin-wrappers/git-{receive-pack,upload-archive}
716+
git add -f $(test_bindir_programs)
717+
# remote-ext is a builtin, but invoked as if it were external
718+
sed 's|receive-pack|remote-ext|g' \
719+
<bin-wrappers/git-receive-pack >bin-wrappers/git-remote-ext
720+
git add -f bin-wrappers/git-remote-ext
721+
722+
# Add templates
723+
$(MAKE) -C templates
724+
git add -f templates/boilerplates.made templates/blt/
725+
726+
# Add build options
727+
$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 GIT-BUILD-OPTIONS
728+
git add -f GIT-BUILD-OPTIONS
729+
730+
# Commit the whole shebang
731+
git commit -m "Generate Visual Studio solution" \
732+
-m "Auto-generated by \`$(MAKE)$(MAKEFLAGS) $@\`"

contrib/buildsystems/Generators.pm

+1-1
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)