Skip to content

Commit

Permalink
tools: allow passing absolute path of config.gypi in js2c
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Nov 21, 2023
1 parent 1f03f6b commit 9e3760e
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions patches/node/build_add_gn_build_files.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2350,22 +2350,4 @@ index 11616e1bcac5308020eb68fdb811bfb86cb14dd5..845e6ce69d93983963a7a57117ecab3b

if 'false' == variables.get('node_shared_libuv'):
subdir_files('deps/uv/include', 'include/node/', action)
diff --git a/tools/js2c.py b/tools/js2c.py
index 54c7dfce3631001e108570b19d34966edafd624f..077bba1572f05f1aa16553894703b12abc19a985 100755
--- a/tools/js2c.py
+++ b/tools/js2c.py
@@ -131,6 +131,14 @@ def NormalizeFileName(filename):
split = split[1:]
if len(split):
filename = '/'.join(split)
+
+ # Electron-specific: when driving the node build from Electron, we generate
+ # config.gypi in a separate directory and pass the absolute path to js2c.
+ # This overrides the absolute path so that the variable names in the
+ # generated C are as if it was in the root node directory.
+ if filename.endswith("/config.gypi"):
+ filename = "config.gypi"
+
return os.path.splitext(filename)[0]



0 comments on commit 9e3760e

Please sign in to comment.