We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8168926 + f18bc14 commit cf2ed25Copy full SHA for cf2ed25
Makefile
@@ -3836,12 +3836,15 @@ ifdef MSVC
3836
$(RM) $(patsubst %.o,%.o.pdb,$(OBJECTS))
3837
$(RM) headless-git.o.pdb
3838
$(RM) $(patsubst %.exe,%.pdb,$(OTHER_PROGRAMS))
3839
+ $(RM) $(patsubst %.exe,%.ilk,$(OTHER_PROGRAMS))
3840
$(RM) $(patsubst %.exe,%.iobj,$(OTHER_PROGRAMS))
3841
$(RM) $(patsubst %.exe,%.ipdb,$(OTHER_PROGRAMS))
3842
$(RM) $(patsubst %.exe,%.pdb,$(PROGRAMS))
3843
+ $(RM) $(patsubst %.exe,%.ilk,$(PROGRAMS))
3844
$(RM) $(patsubst %.exe,%.iobj,$(PROGRAMS))
3845
$(RM) $(patsubst %.exe,%.ipdb,$(PROGRAMS))
3846
$(RM) $(patsubst %.exe,%.pdb,$(TEST_PROGRAMS))
3847
+ $(RM) $(patsubst %.exe,%.ilk,$(TEST_PROGRAMS))
3848
$(RM) $(patsubst %.exe,%.iobj,$(TEST_PROGRAMS))
3849
$(RM) $(patsubst %.exe,%.ipdb,$(TEST_PROGRAMS))
3850
$(RM) compat/vcbuild/MSVC-DEFS-GEN
compat/vcbuild/find_vs_env.bat
@@ -99,6 +99,7 @@ REM ================================================================
99
100
SET sdk_dir=%WindowsSdkDir%
101
SET sdk_ver=%WindowsSDKVersion%
102
+ SET sdk_ver_bin_dir=%WindowsSdkVerBinPath%%tgt%
103
SET si=%sdk_dir%Include\%sdk_ver%
104
SET sdk_includes=-I"%si%ucrt" -I"%si%um" -I"%si%shared"
105
SET sl=%sdk_dir%lib\%sdk_ver%
@@ -130,6 +131,7 @@ REM ================================================================
130
131
132
133
134
+ SET sdk_ver_bin_dir=%WindowsSdkVerBinPath%bin\amd64
135
136
SET sdk_includes=-I"%si%ucrt" -I"%si%um" -I"%si%shared" -I"%si%winrt"
137
@@ -160,6 +162,11 @@ REM ================================================================
160
162
echo msvc_includes=%msvc_includes%
161
163
echo msvc_libs=%msvc_libs%
164
165
+ echo sdk_ver_bin_dir=%sdk_ver_bin_dir%
166
+ SET X1=%sdk_ver_bin_dir:C:=/C%
167
+ SET X2=%X1:\=/%
168
+ echo sdk_ver_bin_dir_msys=%X2%
169
+
170
echo sdk_includes=%sdk_includes%
171
echo sdk_libs=%sdk_libs%
172
compat/vcbuild/scripts/clink.pl
@@ -15,6 +15,7 @@
15
my @lflags = ();
16
my $is_linking = 0;
17
my $is_debug = 0;
18
+my $is_gui = 0;
19
while (@ARGV) {
20
my $arg = shift @ARGV;
21
if ("$arg" eq "-DDEBUG") {
@@ -67,7 +68,11 @@
67
68
}
69
push(@args, $lib);
70
} elsif ("$arg" eq "-lexpat") {
71
+ if ($is_debug) {
72
+ push(@args, "libexpatd.lib");
73
+ } else {
74
push(@args, "libexpat.lib");
75
+ }
76
} elsif ("$arg" =~ /^-L/ && "$arg" ne "-LTCG") {
77
$arg =~ s/^-L/-LIBPATH:/;
78
push(@lflags, $arg);
@@ -119,11 +124,23 @@
119
124
push(@cflags, "-wd4996");
120
125
} elsif ("$arg" =~ /^-W[a-z]/) {
121
126
# let's ignore those
127
+ } elsif ("$arg" eq "-fno-stack-protector") {
128
+ # eat this
129
+ } elsif ("$arg" eq "-mwindows") {
+ $is_gui = 1;
122
} else {
123
push(@args, $arg);
if ($is_linking) {
+ if ($is_gui) {
+ push(@args, "-ENTRY:wWinMainCRTStartup");
138
+ push(@args, "-SUBSYSTEM:WINDOWS");
139
140
+ push(@args, "-ENTRY:wmainCRTStartup");
141
+ push(@args, "-SUBSYSTEM:CONSOLE");
142
143
144
push(@args, @lflags);
145
unshift(@args, "link.exe");
146
compat/vcbuild/scripts/rc.pl
@@ -0,0 +1,46 @@
1
+#!/usr/bin/perl -w
2
+######################################################################
3
+# Compile Resources on Windows
4
+#
5
+# This is a wrapper to facilitate the compilation of Git with MSVC
6
+# using GNU Make as the build system. So, instead of manipulating the
7
+# Makefile into something nasty, just to support non-space arguments
8
+# etc, we use this wrapper to fix the command line options
9
10
11
+use strict;
12
+my @args = ();
13
+my @input = ();
14
+while (@ARGV) {
+ my $arg = shift @ARGV;
+ if ("$arg" =~ /^-[dD]/) {
+ # GIT_VERSION gets passed with too many
+ # layers of dquote escaping.
+ $arg =~ s/\\"/"/g;
22
+ push(@args, $arg);
23
24
+ } elsif ("$arg" eq "-i") {
25
26
+ # TODO complain if NULL or is dashed ??
27
+ push(@input, $arg);
28
29
+ } elsif ("$arg" eq "-o") {
30
31
32
+ push(@args, "-fo$arg");
33
34
35
36
37
+}
38
39
+push(@args, "-nologo");
40
+push(@args, "-v");
41
+push(@args, @input);
42
43
+unshift(@args, "rc.exe");
44
+printf("**** @args\n");
45
46
+exit (system(@args) != 0);
config.mak.uname
@@ -451,7 +451,7 @@ ifeq ($(uname_S),Windows)
451
# link.exe next to, and required by, cl.exe, we have to prepend this
452
# onto the existing $PATH.
453
#
454
- SANE_TOOL_PATH ?= $(msvc_bin_dir_msys)
+ SANE_TOOL_PATH ?= $(msvc_bin_dir_msys):$(sdk_ver_bin_dir_msys)
455
HAVE_ALLOCA_H = YesPlease
456
NO_PREAD = YesPlease
457
NEEDS_CRYPTO_WITH_SSL = YesPlease
@@ -513,12 +513,14 @@ endif
513
compat/win32/trace2_win32_process_info.o \
514
compat/win32/dirent.o
515
COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DDETECT_MSYS_TTY -DENSURE_MSYSTEM_IS_SET -DNOGDI -DHAVE_STRING_H -Icompat -Icompat/regex -Icompat/win32 -DSTRIP_EXTENSION=\".exe\"
516
- BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -ENTRY:wmainCRTStartup -SUBSYSTEM:CONSOLE
+ BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO
517
# invalidcontinue.obj allows Git's source code to close the same file
518
# handle twice, or to access the osfhandle of an already-closed stdout
519
# See https://msdn.microsoft.com/en-us/library/ms235330.aspx
520
EXTLIBS = user32.lib advapi32.lib shell32.lib wininet.lib ws2_32.lib invalidcontinue.obj kernel32.lib ntdll.lib
521
+ GITLIBS += git.res
522
PTHREAD_LIBS =
523
+ RC = compat/vcbuild/scripts/rc.pl
524
lib =
525
BASIC_CFLAGS += $(vcpkg_inc) $(sdk_includes) $(msvc_includes)
526
ifndef DEBUG
0 commit comments