diff --git a/node.gypi b/node.gypi index 9138317c62c7cd..95133818dff7c7 100644 --- a/node.gypi +++ b/node.gypi @@ -141,6 +141,7 @@ } ], [ 'node_shared_zlib=="false"', { 'dependencies': [ 'deps/zlib/zlib.gyp:zlib' ], + 'defines': [ 'NODE_BUNDLED_ZLIB' ], 'conditions': [ [ 'force_load=="true"', { 'xcode_settings': { diff --git a/src/node_metadata.cc b/src/node_metadata.cc index b88cfb98e75aca..844c5ac2c2b948 100644 --- a/src/node_metadata.cc +++ b/src/node_metadata.cc @@ -14,7 +14,12 @@ #include "uv.h" #include "uvwasi.h" #include "v8.h" + +#ifdef NODE_BUNDLED_ZLIB #include "zlib_version.h" +#else +#include +#endif // NODE_BUNDLED_ZLIB #if HAVE_OPENSSL #include @@ -78,7 +83,11 @@ Metadata::Versions::Versions() { node = NODE_VERSION_STRING; v8 = v8::V8::GetVersion(); uv = uv_version_string(); +#ifdef NODE_BUNDLED_ZLIB zlib = ZLIB_VERSION; +#else + zlib = zlibVersion(); +#endif // NODE_BUNDLED_ZLIB ares = ARES_VERSION_STR; modules = NODE_STRINGIFY(NODE_MODULE_VERSION); nghttp2 = NGHTTP2_VERSION;