summaryrefslogtreecommitdiffstats
path: root/patches/chromium/tools/gyp/0001-Fix-build-with-toplevel-dir.patch
blob: 0ab2861ee7ddb3f3da9bf9ad8f80ffd38b8e32de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Pierre Rossi <pierre.rossi@digia.com>
Date: Mon, 13 May 2013 16:25:46 +0200
Subject: Fix build with toplevel-dir

---
 pylib/gyp/generator/ninja.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/pylib/gyp/generator/ninja.py b/pylib/gyp/generator/ninja.py
index 9011807..6fe07c5 100644
--- a/pylib/gyp/generator/ninja.py
+++ b/pylib/gyp/generator/ninja.py
@@ -1476,9 +1476,13 @@ def CalculateVariables(default_variables, params):
     default_variables.setdefault('SHARED_LIB_SUFFIX', '.so')
     default_variables.setdefault('SHARED_LIB_DIR',
                                  os.path.join('$!PRODUCT_DIR', 'lib'))
+    # Take into account the fact that toplevel_dir might not be equal to depth
+    toplevel_offset = ''
+    if 'options' in params:
+      options = params['options']
+      toplevel_offset = os.path.relpath(options.depth, options.toplevel_dir)
     default_variables.setdefault('LIB_DIR',
-                                 os.path.join('$!PRODUCT_DIR', 'obj'))
-
+                                 os.path.join('$!PRODUCT_DIR', 'obj', toplevel_offset))
 
 def OpenOutput(path, mode='w'):
   """Open |path| for writing, creating directories if necessary."""