Commit 4c294b3b272 for nodejs

commit 4c294b3b27218b8c527860490a33aebe46ac4892
Author: StefanStojanovic <stefan.stojanovic@janeasystems.com>
Date:   Wed Sep 9 08:24:06 2026 +0200

    build,win: fix Perfetto

    Signed-off-by: StefanStojanovic <stefan.stojanovic@janeasystems.com>
    Co-Authored-By: Chengzhong Wu <cwu631@bloomberg.net>
    PR-URL: https://github.com/nodejs/node/pull/66876
    Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
    Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>

diff --git a/deps/perfetto/perfetto.gyp b/deps/perfetto/perfetto.gyp
index 083d0b386dd..697256401a3 100644
--- a/deps/perfetto/perfetto.gyp
+++ b/deps/perfetto/perfetto.gyp
@@ -18,6 +18,14 @@
       'sources': [
         '<@(perfetto_sdk_sources)',
       ],
+      'conditions': [
+        ['OS=="win"', {
+          'defines': [
+            'WIN32_LEAN_AND_MEAN',
+            'NOMINMAX',
+          ],
+        }],
+      ],
     },
   ]
 }
diff --git a/node.gypi b/node.gypi
index 9eb972adc47..3ca9d4633d0 100644
--- a/node.gypi
+++ b/node.gypi
@@ -93,6 +93,11 @@
     [ 'OS=="linux" and target_arch=="s390x"', {
       'cflags': [ '-march=z14' ],
     }],
+    [ 'v8_use_perfetto==1 and node_shared_perfetto=="false"', {
+      'dependencies': [
+        'deps/perfetto/perfetto.gyp:perfetto_sdk',
+      ],
+    }],
     [ 'node_enable_d8=="true"', {
       'dependencies': [ 'tools/v8_gypfiles/d8.gyp:d8' ],
     }],
diff --git a/tools/v8_gypfiles/features.gypi b/tools/v8_gypfiles/features.gypi
index a6e2c9b0d0e..305c81eab34 100644
--- a/tools/v8_gypfiles/features.gypi
+++ b/tools/v8_gypfiles/features.gypi
@@ -62,7 +62,7 @@
       }, {
         'is_component_build': 0,
       }],
-      ['OS == "win" or OS == "mac"', {
+      ['(OS == "win" or OS == "mac") and v8_use_perfetto == 0', {
         # Sets -DENABLE_SYSTEM_INSTRUMENTATION. Enables OS-dependent event tracing
         'v8_enable_system_instrumentation': 1,
       }, {