From eb2402d56934db9586df867223603dc97587dad2 Mon Sep 17 00:00:00 2001 From: Pooja D P Date: Tue, 24 Nov 2020 22:49:21 -0800 Subject: [PATCH] build: enable building with shared uvwasi lib Fixes: https://github.com/nodejs/node/issues/35339 Co-authored-by: Pooja D P Co-authored-by: Teutates <103068388+Teutates@users.noreply.github.com> Co-authored-by: Antoine du Hamel PR-URL: https://github.com/nodejs/node/pull/43987 Reviewed-By: Michael Dawson Reviewed-By: James M Snell --- configure.py | 23 +++++++++++++++++++++++ node.gyp | 11 +++-------- node.gypi | 4 ++++ 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/configure.py b/configure.py index 468c0370bfa523..4d13adeed0d704 100755 --- a/configure.py +++ b/configure.py @@ -381,6 +381,28 @@ dest='shared_openssl_libpath', help='a directory to search for the shared OpenSSL DLLs') +shared_optgroup.add_argument('--shared-uvwasi', + action='store_true', + dest='shared_uvwasi', + default=None, + help='link to a shared uvwasi DLL instead of static linking') + +shared_optgroup.add_argument('--shared-uvwasi-includes', + action='store', + dest='shared_uvwasi_includes', + help='directory containing uvwasi header files') + +shared_optgroup.add_argument('--shared-uvwasi-libname', + action='store', + dest='shared_uvwasi_libname', + default='uvwasi', + help='alternative lib name to link to [default: %default]') + +shared_optgroup.add_argument('--shared-uvwasi-libpath', + action='store', + dest='shared_uvwasi_libpath', + help='a directory to search for the shared uvwasi DLL') + shared_optgroup.add_argument('--shared-zlib', action='store_true', dest='shared_zlib', @@ -2119,6 +2141,7 @@ def make_bin_override(): configure_library('nghttp2', output, pkgname='libnghttp2') configure_library('nghttp3', output, pkgname='libnghttp3') configure_library('ngtcp2', output, pkgname='libngtcp2') +configure_library('uvwasi', output, pkgname='libuvwasi') configure_v8(output) configure_openssl(output) configure_intl(output) diff --git a/node.gyp b/node.gyp index ca6a4cdcb2eebe..da7f3e9940cd19 100644 --- a/node.gyp +++ b/node.gyp @@ -19,6 +19,7 @@ 'node_shared_http_parser%': 'false', 'node_shared_cares%': 'false', 'node_shared_libuv%': 'false', + 'node_shared_uvwasi%': 'false', 'node_shared_nghttp2%': 'false', 'node_use_openssl%': 'true', 'node_shared_openssl%': 'false', @@ -534,7 +535,6 @@ 'dependencies': [ 'deps/histogram/histogram.gyp:histogram', - 'deps/uvwasi/uvwasi.gyp:uvwasi', ], 'msvs_settings': { @@ -1014,8 +1014,8 @@ 'dependencies': [ '<(node_lib_target_name)', 'deps/histogram/histogram.gyp:histogram', - 'deps/uvwasi/uvwasi.gyp:uvwasi', ], + 'includes': [ 'node.gypi' ], @@ -1025,9 +1025,9 @@ 'deps/v8/include', 'deps/cares/include', 'deps/uv/include', - 'deps/uvwasi/include', 'test/cctest', ], + 'defines': [ 'NODE_ARCH="<(target_arch)"', 'NODE_PLATFORM="<(OS)"', @@ -1164,7 +1164,6 @@ 'deps/v8/include', 'deps/cares/include', 'deps/uv/include', - 'deps/uvwasi/include', 'test/cctest', ], @@ -1226,7 +1225,6 @@ 'dependencies': [ '<(node_lib_target_name)', 'deps/histogram/histogram.gyp:histogram', - 'deps/uvwasi/uvwasi.gyp:uvwasi', 'deps/ada/ada.gyp:ada', ], @@ -1241,7 +1239,6 @@ 'deps/v8/include', 'deps/cares/include', 'deps/uv/include', - 'deps/uvwasi/include', 'test/embedding', ], @@ -1341,7 +1338,6 @@ 'dependencies': [ '<(node_lib_target_name)', 'deps/histogram/histogram.gyp:histogram', - 'deps/uvwasi/uvwasi.gyp:uvwasi', 'deps/ada/ada.gyp:ada', ], @@ -1355,7 +1351,6 @@ 'deps/v8/include', 'deps/cares/include', 'deps/uv/include', - 'deps/uvwasi/include', ], 'defines': [ 'NODE_WANT_INTERNALS=1' ], diff --git a/node.gypi b/node.gypi index e908076aed279a..46c7c7e353f29b 100644 --- a/node.gypi +++ b/node.gypi @@ -208,6 +208,10 @@ ], }], + [ 'node_shared_uvwasi=="false"', { + 'dependencies': [ 'deps/uvwasi/uvwasi.gyp:uvwasi' ], + }], + [ 'node_shared_nghttp2=="false"', { 'dependencies': [ 'deps/nghttp2/nghttp2.gyp:nghttp2' ], }],