aboutsummaryrefslogtreecommitdiffstats
path: root/community/chromium/gn_bootstrap_ninja.patch
blob: 88dc0a65000634c1a5d810010181053019676cb9 (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
30
31
32
Patch by Michael Forney <mforney@mforney.org>

Already merged https://chromium-review.googlesource.com/c/chromium/src/+/1975453

--- tools/gn/bootstrap/bootstrap.py
+++ tools/gn/bootstrap/bootstrap.py
@@ -70,6 +70,7 @@
   out_dir = os.path.join(SRC_ROOT, build_rel)
   gn_path = options.output or os.path.join(out_dir, 'gn')
   gn_build_dir = os.path.join(out_dir, 'gn_build')
+  ninja_binary = os.environ.get('NINJA', 'ninja')
 
   # TODO(thomasanderson): Remove this once Ubuntu Trusty reaches EOL, or when
   # Chromium's infrastructure is upgraded from Trusty to Xenial, whichever comes
@@ -90,7 +91,7 @@
               os.environ.get('CFLAGS', '').split() +
               os.environ.get('CXXFLAGS', '').split()),
       ]) + '\n')
-    subprocess.check_call(['ninja', '-C', libcxx_dir])
+    subprocess.check_call([ninja_binary, '-C', libcxx_dir])
     shutil.copy2(os.path.join(gn_build_dir, 'libc++.gn.so'), out_dir)
 
     def append_to_env(var, vals):
@@ -120,7 +121,7 @@
   shutil.copy2(
       os.path.join(BOOTSTRAP_DIR, 'last_commit_position.h'), gn_build_dir)
   subprocess.check_call(
-      ['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err'])
+      [ninja_binary, '-C', gn_build_dir, '-w', 'dupbuild=err', 'gn'])
   shutil.copy2(os.path.join(gn_build_dir, 'gn'), gn_path)
 
   if not options.skip_generate_buildfiles: