Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Find openssl lib files in right directory for MSVC
authorAndrew Dunstan <andrew@dunslane.net>
Mon, 5 Jun 2017 18:24:42 +0000 (14:24 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Mon, 5 Jun 2017 18:27:59 +0000 (14:27 -0400)
Some openssl builds put their lib files in a VC subdirectory, others do
not. Cater for both cases.

Backpatch to all live branches.

From an offline discussion with Leonardo Cecchi.

src/tools/msvc/Solution.pm

index 666605b47b9acd558ed007fa82b3dad131fc5624..8191a40ea5052edb81ed4c53c2f4c6c38556cafd 100644 (file)
@@ -523,10 +523,20 @@ sub AddProject
    if ($self->{options}->{openssl})
    {
        $proj->AddIncludeDir($self->{options}->{openssl} . '\include');
-       $proj->AddLibrary(
-           $self->{options}->{openssl} . '\lib\VC\ssleay32.lib', 1);
-       $proj->AddLibrary(
-           $self->{options}->{openssl} . '\lib\VC\libeay32.lib', 1);
+       if (-e "$self->{options}->{openssl}/lib/VC/ssleayMD.lib")
+       {
+           $proj->AddLibrary(
+               $self->{options}->{openssl} . '\lib\VC\ssleay32.lib', 1);
+           $proj->AddLibrary(
+               $self->{options}->{openssl} . '\lib\VC\libeay32.lib', 1);
+       }
+       else
+       {
+           $proj->AddLibrary(
+               $self->{options}->{openssl} . '\lib\ssleay32.lib', 1);
+           $proj->AddLibrary(
+               $self->{options}->{openssl} . '\lib\libeay32.lib', 1);
+       }
    }
    if ($self->{options}->{nls})
    {