From 7df0fc5c5c074ef9fe342b47eceb6437311aeab8 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Wed, 7 Apr 2021 09:00:16 +0200 Subject: [PATCH] build: move OPENSSL_API_COMPAT to else clause MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently there are a number of deprecation warnings generated when linking with OpenSSL 3.0, for example: In file included from ../src/crypto/crypto_scrypt.h:6, from ../src/crypto/crypto_scrypt.cc:1: ../src/crypto/crypto_util.h:64:37: warning: ‘void RSA_free(RSA*)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations] 64 | using RSAPointer = DeleteFnPtr; The reason for this is that I had placed the macro OPENSSL_API_COMPAT inside of the node_shared_openssl="false" clause, but that was a mistake and this macro should have gone into the else clause instead. PR-URL: https://github.com/nodejs/node/pull/38126 Reviewed-By: Richard Lau Reviewed-By: James M Snell --- node.gypi | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/node.gypi b/node.gypi index dde4f8332d542e..a3c927956ec53f 100644 --- a/node.gypi +++ b/node.gypi @@ -326,9 +326,6 @@ # For tests './deps/openssl/openssl.gyp:openssl-cli', ], - # Set 1.0.0 as the API compability level to avoid the - # deprecation warnings when using OpenSSL 3.0. - 'defines': ['OPENSSL_API_COMPAT=0x10000000L'], 'conditions': [ # -force_load or --whole-archive are not applicable for # the static library @@ -364,6 +361,10 @@ ], }], ] + }, { + # Set 1.0.0 as the API compability level to avoid the + # deprecation warnings when using OpenSSL 3.0. + 'defines': [ 'OPENSSL_API_COMPAT=0x10000000L', ] }], [ 'openssl_quic=="true" and node_shared_ngtcp2=="false"', { 'dependencies': [ './deps/ngtcp2/ngtcp2.gyp:ngtcp2' ]