Skip to content

Commit e2d58ac

Browse files
jeffhostetlerdscho
authored andcommitted
Merge branch 'visual-studio'
Signed-off-by: Johannes Schindelin <[email protected]>
2 parents cddcf33 + ef3bf74 commit e2d58ac

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
@@ -191,6 +191,42 @@
191191
/gitweb/static/gitweb.js
192192
/gitweb/static/gitweb.min.*
193193
/command-list.h
194+
/libgit
195+
/test-chmtime
196+
/test-ctype
197+
/test-config
198+
/test-date
199+
/test-delta
200+
/test-dump-cache-tree
201+
/test-dump-split-index
202+
/test-dump-untracked-cache
203+
/test-fake-ssh
204+
/test-scrap-cache-tree
205+
/test-genrandom
206+
/test-hashmap
207+
/test-index-version
208+
/test-line-buffer
209+
/test-match-trees
210+
/test-mergesort
211+
/test-mktemp
212+
/test-parse-options
213+
/test-path-utils
214+
/test-prio-queue
215+
/test-read-cache
216+
/test-regex
217+
/test-revision-walking
218+
/test-run-command
219+
/test-sha1
220+
/test-sha1-array
221+
/test-sigchain
222+
/test-string-list
223+
/test-submodule-config
224+
/test-subprocess
225+
/test-svn-fe
226+
/test-urlmatch-normalization
227+
/test-wildmatch
228+
/vcs-svn_lib
229+
/xdiff_lib
194230
*.tar.gz
195231
*.dsc
196232
*.deb
@@ -233,6 +269,10 @@
233269
*.ipdb
234270
*.dll
235271
.vs/
236-
/Debug/
237-
/Release/
272+
*.manifest
273+
Debug/
274+
Release/
275+
/UpgradeLog*.htm
276+
/git.VC.VC.opendb
277+
/git.VC.db
238278
*.dSYM

Makefile

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

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