This reduces warnings, and supports additional linker
flags (such as -DEBUG and -MAP)
Signed-off-by: Peter Harris <redacted>
---
Makefile | 1 +
compat/vcbuild/scripts/clink.pl | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index 7134509..d4fd4b0 100644
--- a/Makefile
+++ b/Makefile
@@ -1073,6 +1073,7 @@ ifndef DEBUG
AR += -LTCG
else
BASIC_CFLAGS += -Zi -MTd
+ BASIC_LDFLAGS = -DEBUG -MAP
endif
X = .exe
endif
diff --git a/compat/vcbuild/scripts/clink.pl b/compat/vcbuild/scripts/clink.pl
index 4374771..3f51886 100644
--- a/compat/vcbuild/scripts/clink.pl
+++ b/compat/vcbuild/scripts/clink.pl
@@ -12,10 +12,14 @@
use strict;
my @args = ();
my @cflags = ();
+my @lflags = ();
my $is_linking = 0;
+my %linkflag = ( '-DEBUG' => 1, '-MAP' => 1 );
while (@ARGV) {
my $arg = shift @ARGV;
- if ("$arg" =~ /^-[DIMGO]/) {
+ if ($linkflag{$arg}) {
+ push(@lflags, $arg);
+ } elsif ("$arg" =~ /^-[DIMGOWZ]/) {
push(@cflags, $arg);
} elsif ("$arg" eq "-o") {
my $file_out = shift @ARGV;@@ -44,6 +48,7 @@ while (@ARGV) {
}
if ($is_linking) {
unshift(@args, "link.exe");
+ push(@args, @lflags);
} else {
unshift(@args, "cl.exe");
push(@args, @cflags);--
1.7.1.msysgit.0.4.gea744.MSVC