Skip to content

Commit

Permalink
fix: duplicate ninja rules for v8 (cross-compiling)
Browse files Browse the repository at this point in the history
avoids duplicate ninja rules for v8 used in host and target

From: minrk/node@5e533cb
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Reported in nodejs/node#46690
and nodejs/node#37441

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
  • Loading branch information
minrk authored and moto-timo committed Feb 18, 2023
1 parent ac262fe commit 2a5c42e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pylib/gyp/generator/ninja.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
# the start of a string, while $| is used for variables that can appear
# anywhere in a string.
"INTERMEDIATE_DIR": "$!INTERMEDIATE_DIR",
"SHARED_INTERMEDIATE_DIR": "$!PRODUCT_DIR/gen",
"SHARED_INTERMEDIATE_DIR": "$!PRODUCT_DIR/$|OBJ/gen",
"PRODUCT_DIR": "$!PRODUCT_DIR",
"CONFIGURATION_NAME": "$|CONFIGURATION_NAME",
# Special variables that may be used by gyp 'rule' targets.
Expand Down Expand Up @@ -285,6 +285,12 @@ def ExpandSpecial(self, path, product_dir=None):
CONFIGURATION_NAME = "$|CONFIGURATION_NAME"
path = path.replace(CONFIGURATION_NAME, self.config_name)

obj = "obj"
if self.toolset != "target":
obj += "." + self.toolset

path = path.replace("$|OBJ", obj)

return path

def ExpandRuleVariables(self, path, root, dirname, source, ext, name):
Expand Down

0 comments on commit 2a5c42e

Please sign in to comment.