0003-include-obj-name-in-shared-intermediate.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. From af47d317e5ae12978c1cdc40627008ada144f98b Mon Sep 17 00:00:00 2001
  2. From: Min RK <benjaminrk@gmail.com>
  3. Date: Fri, 19 Feb 2021 11:57:04 +0100
  4. Subject: [PATCH] include obj name in shared intermediate
  5. avoids duplicate ninja rules for v8 used in host and target
  6. From: https://github.com/minrk/node/commit/5e533cb943eef68b270f55f0cba02c0ec67c699d
  7. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  8. ---
  9. tools/gyp/pylib/gyp/generator/ninja.py | 8 +++++++-
  10. 1 file changed, 7 insertions(+), 1 deletion(-)
  11. diff --git a/tools/gyp/pylib/gyp/generator/ninja.py b/tools/gyp/pylib/gyp/generator/ninja.py
  12. index 3db3771ac9..2e0a021703 100644
  13. --- a/tools/gyp/pylib/gyp/generator/ninja.py
  14. +++ b/tools/gyp/pylib/gyp/generator/ninja.py
  15. @@ -42,7 +42,7 @@ generator_default_variables = {
  16. # the start of a string, while $| is used for variables that can appear
  17. # anywhere in a string.
  18. "INTERMEDIATE_DIR": "$!INTERMEDIATE_DIR",
  19. - "SHARED_INTERMEDIATE_DIR": "$!PRODUCT_DIR/gen",
  20. + "SHARED_INTERMEDIATE_DIR": "$!PRODUCT_DIR/$|OBJ/gen",
  21. "PRODUCT_DIR": "$!PRODUCT_DIR",
  22. "CONFIGURATION_NAME": "$|CONFIGURATION_NAME",
  23. # Special variables that may be used by gyp 'rule' targets.
  24. @@ -285,6 +285,12 @@ class NinjaWriter:
  25. CONFIGURATION_NAME = "$|CONFIGURATION_NAME"
  26. path = path.replace(CONFIGURATION_NAME, self.config_name)
  27. + obj = "obj"
  28. + if self.toolset != "target":
  29. + obj += "." + self.toolset
  30. +
  31. + path = path.replace("$|OBJ", obj)
  32. +
  33. return path
  34. def ExpandRuleVariables(self, path, root, dirname, source, ext, name):
  35. --
  36. 2.37.3