Skip to content

Commit a4df7c2

Browse files
jeffhostetlerdscho
authored andcommitted
msvc: update compile helper for VS2015
Support -Z flags ("specify PDB options"), only include -l args on link commands, and force PDBs to be created. Signed-off-by: Jeff Hostetler <[email protected]>
1 parent 3189231 commit a4df7c2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

compat/vcbuild/scripts/clink.pl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
use strict;
1313
my @args = ();
1414
my @cflags = ();
15+
my @lflags = ();
1516
my $is_linking = 0;
1617
while (@ARGV) {
1718
my $arg = shift @ARGV;
18-
if ("$arg" =~ /^-[DIMGO]/) {
19+
if ("$arg" =~ /^-[DIMGOZ]/) {
1920
push(@cflags, $arg);
2021
} elsif ("$arg" eq "-o") {
2122
my $file_out = shift @ARGV;
@@ -35,16 +36,21 @@
3536
push(@args, "ssleay32.lib");
3637
} elsif ("$arg" eq "-lcurl") {
3738
push(@args, "libcurl.lib");
39+
} elsif ("$arg" eq "-lexpat") {
40+
push(@args, "libexpat.lib");
3841
} elsif ("$arg" =~ /^-L/ && "$arg" ne "-LTCG") {
3942
$arg =~ s/^-L/-LIBPATH:/;
40-
push(@args, $arg);
43+
push(@lflags, $arg);
4144
} elsif ("$arg" =~ /^-R/) {
4245
# eat
4346
} else {
4447
push(@args, $arg);
4548
}
4649
}
4750
if ($is_linking) {
51+
push(@args, @lflags);
52+
# force PDB to be created.
53+
push(@args, "-debug");
4854
unshift(@args, "link.exe");
4955
} else {
5056
unshift(@args, "cl.exe");

0 commit comments

Comments
 (0)