Skip to content

Commit 2f16f6b

Browse files
committed
msvc: ignore some libraries when linking
To build with MSVC, we "translate" GCC options to MSVC options, and part of those options refer to the libraries to link into the final executable. Currently, this part looks somewhat like this on Windows: -lcurl -lnghttp2 -lidn2 -lssl -lcrypto -lssl -lcrypto -lgdi32 -lcrypt32 -lwldap32 -lz -lws2_32 -lexpat Some of those are direct dependencies (such as curl and ssl) and others are indirect (nghttp2 and idn2, for example, are dependencies of curl, but need to be linked in for reasons). We already handle the direct dependencies, e.g. `-liconv` is already handled as adding `libiconv.lib` to the list of libraries to link against. Let's just ignore the remaining `-l*` options so that MSVC does not have to warn us that it ignored e.g. the `/lnghttp2` option. We do that by extending the clause that already "eats" the `-R*` options to also eat the `-l*` options. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent d9eeac6 commit 2f16f6b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compat/vcbuild/scripts/clink.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
} elsif ("$arg" =~ /^-L/ && "$arg" ne "-LTCG") {
5656
$arg =~ s/^-L/-LIBPATH:/;
5757
push(@lflags, $arg);
58-
} elsif ("$arg" =~ /^-R/) {
58+
} elsif ("$arg" =~ /^-[Rl]/) {
5959
# eat
6060
} else {
6161
push(@args, $arg);

0 commit comments

Comments
 (0)