mirror of
https://github.com/git-for-windows/git.git
synced 2026-02-04 03:33:01 -06:00
clink.pl: move default linker options for MSVC=1 builds
Move the default `-ENTRY` and `-SUBSYSTEM` arguments for MSVC=1 builds from `config.mak.uname` into `clink.pl`. These args are constant for console-mode executables. Add support to `clink.pl` for generating a Win32 GUI application using the `-mwindows` argument (to match how GCC does it). This changes the `-ENTRY` and `-SUBSYSTEM` arguments accordingly. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
This commit is contained in:
parent
07a0143980
commit
ceda56d552
@ -15,6 +15,7 @@ my @cflags = ();
|
||||
my @lflags = ();
|
||||
my $is_linking = 0;
|
||||
my $is_debug = 0;
|
||||
my $is_gui = 0;
|
||||
while (@ARGV) {
|
||||
my $arg = shift @ARGV;
|
||||
if ("$arg" eq "-DDEBUG") {
|
||||
@ -124,11 +125,21 @@ while (@ARGV) {
|
||||
# let's ignore those
|
||||
} elsif ("$arg" eq "-fno-stack-protector") {
|
||||
# eat this
|
||||
} elsif ("$arg" eq "-mwindows") {
|
||||
$is_gui = 1;
|
||||
} else {
|
||||
push(@args, $arg);
|
||||
}
|
||||
}
|
||||
if ($is_linking) {
|
||||
if ($is_gui) {
|
||||
push(@args, "-ENTRY:wWinMainCRTStartup");
|
||||
push(@args, "-SUBSYSTEM:WINDOWS");
|
||||
} else {
|
||||
push(@args, "-ENTRY:wmainCRTStartup");
|
||||
push(@args, "-SUBSYSTEM:CONSOLE");
|
||||
}
|
||||
|
||||
push(@args, @lflags);
|
||||
unshift(@args, "link.exe");
|
||||
} else {
|
||||
|
||||
@ -510,7 +510,7 @@ endif
|
||||
compat/win32/trace2_win32_process_info.o \
|
||||
compat/win32/dirent.o
|
||||
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\"
|
||||
BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -ENTRY:wmainCRTStartup -SUBSYSTEM:CONSOLE
|
||||
BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO
|
||||
# invalidcontinue.obj allows Git's source code to close the same file
|
||||
# handle twice, or to access the osfhandle of an already-closed stdout
|
||||
# See https://msdn.microsoft.com/en-us/library/ms235330.aspx
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user