Description: cherry-pick upstream fix to allow more shared libs
 Because branch 20.x had still hard deps on deps/xxx
 This has been fixed in >= 22 branches.
Last-Update: 2025-11-04
Forwarded: no
Author: Jérémy Lal <kapouer@melix.org>
--- a/node.gyp
+++ b/node.gyp
@@ -830,8 +830,6 @@
         'deps/googletest/googletest.gyp:gtest_prod',
         'deps/histogram/histogram.gyp:histogram',
         'deps/uvwasi/uvwasi.gyp:uvwasi',
-        'deps/simdutf/simdutf.gyp:simdutf',
-        'deps/ada/ada.gyp:ada',
         'node_js2c#host',
       ],
 
@@ -1101,7 +1099,6 @@
         'deps/googletest/googletest.gyp:gtest_prod',
         'deps/histogram/histogram.gyp:histogram',
         'deps/uvwasi/uvwasi.gyp:uvwasi',
-        'deps/ada/ada.gyp:ada',
       ],
       'includes': [
         'node.gypi'
@@ -1148,8 +1145,6 @@
         'deps/googletest/googletest.gyp:gtest_main',
         'deps/histogram/histogram.gyp:histogram',
         'deps/uvwasi/uvwasi.gyp:uvwasi',
-        'deps/simdutf/simdutf.gyp:simdutf',
-        'deps/ada/ada.gyp:ada',
       ],
 
       'includes': [
@@ -1223,7 +1218,6 @@
       'dependencies': [
         '<(node_lib_target_name)',
         'deps/histogram/histogram.gyp:histogram',
-        'deps/ada/ada.gyp:ada',
       ],
 
       'includes': [
@@ -1298,7 +1292,6 @@
       'type': 'executable',
       'toolsets': ['host'],
       'dependencies': [
-        'deps/simdutf/simdutf.gyp:simdutf#host',
       ],
       'include_dirs': [
         'tools',
@@ -1336,7 +1329,6 @@
       'dependencies': [
         '<(node_lib_target_name)',
         'deps/histogram/histogram.gyp:histogram',
-        'deps/ada/ada.gyp:ada',
       ],
 
       'includes': [
--- a/node.gypi
+++ b/node.gypi
@@ -216,6 +216,18 @@
       'dependencies': [ 'deps/nghttp2/nghttp2.gyp:nghttp2' ],
     }],
 
+    [ 'node_shared_ada=="false"', {
+        'dependencies': [ 'deps/ada/ada.gyp:ada' ],
+    }],
+
+    [ 'node_shared_simdjson=="false"', {
+        'dependencies': [ 'deps/simdjson/simdjson.gyp:simdjson' ],
+    }],
+
+    [ 'node_shared_simdutf=="false"', {
+        'dependencies': [ 'deps/simdutf/simdutf.gyp:simdutf' ],
+    }],
+
     [ 'node_shared_brotli=="false"', {
       'dependencies': [ 'deps/brotli/brotli.gyp:brotli' ],
     }],
