Skip to content

Commit

Permalink
vcxproj.pm: fix AdditionalDependencies
Browse files Browse the repository at this point in the history
Add .LIBs for zlib and openssl to <AdditionalDependencies>
to help linker when building with VS2017.

This closes #1234

Note: this patch still leaves a couple of TODOs:

- It should be possible to add GEN.DEPS\lib to
  <AdditionalLibraryDependencies> and then just set
  <AdditionalDependencies> to the library basenames.

- Likewise, you should be able to copy GEN.DEPS\bin\*.dll
  to the destination directory rather than using the full
  paths in the $afterTargets lines.

(This is in line with items in <AdditionalIncludeDirectories>
referencing GEN.DEPS\include.)

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
jeffhostetler authored and dscho committed Sep 20, 2017
1 parent c792e5d commit c752630
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions contrib/buildsystems/Generators/Vcxproj.pm
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,13 @@ sub createProject {
} elsif ($needsCurl && $1 eq 'expat') {
# libexpat is only available targeting v100 and v110
$libs .= ";$rel_dir\\compat\\vcbuild\\GEN.PKGS\\$1.$2\\build\\native\\lib\\v110\\\$(Platform)\\Release\\dynamic\\utf8\\libexpat.lib";
} elsif ($1 eq 'zlib') {
# zlib
$libs .= ";$rel_dir\\compat\\vcbuild\\GEN.PKGS\\$1.v140.windesktop.msvcstl.dyn.rt-dyn.$2\\lib\\native\\v140\\windesktop\\msvcstl\\dyn\\rt-dyn\\x64\\RelWithDebInfo\\zlib.lib";
} elsif ($1 eq 'openssl') {
# openssl
$libs .= ";$rel_dir\\compat\\vcbuild\\GEN.PKGS\\$1.v140.windesktop.msvcstl.dyn.rt-dyn.x64.$2\\lib\\native\\v140\\windesktop\\msvcstl\\dyn\\rt-dyn\\x64\\release\\libeay32.lib";
$libs .= ";$rel_dir\\compat\\vcbuild\\GEN.PKGS\\$1.v140.windesktop.msvcstl.dyn.rt-dyn.x64.$2\\lib\\native\\v140\\windesktop\\msvcstl\\dyn\\rt-dyn\\x64\\release\\ssleay32.lib";
}
next if ($1 =~ /^(zlib$|openssl(?!.*(x64|x86)$))/);
my $targetsFile = "$rel_dir\\compat\\vcbuild\\GEN.PKGS\\$1.$2\\build\\native\\$1.targets";
Expand Down

0 comments on commit c752630

Please sign in to comment.