Skip to content

Commit 5e1338a

Browse files
committed
tools: allow passing absolute path of config.gypi in js2c
nodejs/node#49162
1 parent ce3f31e commit 5e1338a

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

patches/node/build_add_gn_build_files.patch

+1-19
Original file line numberDiff line numberDiff line change
@@ -2350,22 +2350,4 @@ index 11616e1bcac5308020eb68fdb811bfb86cb14dd5..845e6ce69d93983963a7a57117ecab3b
23502350

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

0 commit comments

Comments
 (0)