From 333f002962c0649ff1cbbb42a542d874aac52813 Mon Sep 17 00:00:00 2001 From: dthorpe Date: Thu, 27 Feb 2014 16:54:21 -0800 Subject: [PATCH] Specify OpenSSL lib path so that bitcore references to OpenSSL will link to separate OpenSSL DLL in Windows (following bignum@1.6 pattern). Fixes issue #106 --- binding.gyp | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/binding.gyp b/binding.gyp index ec529c7..046a345 100644 --- a/binding.gyp +++ b/binding.gyp @@ -9,6 +9,42 @@ 'src/eckey.cc' ], 'conditions': [ + # For Windows, require either a 32-bit or 64-bit + # separately-compiled OpenSSL library. + # Currently set up to use with the following OpenSSL distro: + # + # http://slproweb.com/products/Win32OpenSSL.html + [ + 'OS=="win"', + { + 'conditions': + [ + [ + 'target_arch=="x64"', + { + 'variables': { + 'openssl_root%': 'C:/OpenSSL-Win64' + }, + }, { + 'variables': { + 'openssl_root%': 'C:/OpenSSL-Win32' + } + } + ] + ], + 'libraries': [ + '-l<(openssl_root)/lib/libeay32.lib', + ], + 'include_dirs': [ + '<(openssl_root)/include', + ], + }, + + + # Otherwise, if not Windows, link against the exposed OpenSSL + # in Node. + { + "conditions": [ ['node_shared_openssl=="false"', { # so when "node_shared_openssl" is "false", then OpenSSL has been # bundled into the node executable. So we need to include the same @@ -28,7 +64,8 @@ }] ] }] - ] + ]} + ]] } ] }