aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-07-18 18:19:55 +0530
committerJussi Pakkanen <jpakkane@gmail.com>2017-09-18 18:40:24 +0300
commit7c2ae55fab2f0837531188373d276f168845e62f (patch)
treefe72c10b2da78e49add1c593512e1012d2f261df /mesonbuild/backend
parentb9154dd07c357ba616deefb7a608e8b2ca85b7ec (diff)
downloadmeson-7c2ae55fab2f0837531188373d276f168845e62f.zip
meson-7c2ae55fab2f0837531188373d276f168845e62f.tar.gz
meson-7c2ae55fab2f0837531188373d276f168845e62f.tar.bz2
Revert "Revert "Merge pull request #1931 from centricular/use-patched-ninja""
This reverts commit 5eb64a6f3e47b570f544524ef48dc6ef0e4dce59. Let's try again, with a fixed Ninja by QuLogic.
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r--mesonbuild/backend/ninjabackend.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index bac984b..cd92972 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -192,6 +192,9 @@ int dummy;
def generate(self, interp):
self.interpreter = interp
+ self.ninja_command = environment.detect_ninja(log=True)
+ if self.ninja_command is None:
+ raise MesonException('Could not detect Ninja v1.5 or newer')
outfilename = os.path.join(self.environment.get_build_dir(), self.ninja_filename)
tempfilename = outfilename + '~'
with open(tempfilename, 'w') as outfile:
@@ -225,11 +228,10 @@ int dummy;
# http://clang.llvm.org/docs/JSONCompilationDatabase.html
def generate_compdb(self):
- ninja_exe = environment.detect_ninja()
pch_compilers = ['%s_PCH' % i for i in self.build.compilers]
native_compilers = ['%s_COMPILER' % i for i in self.build.compilers]
cross_compilers = ['%s_CROSS_COMPILER' % i for i in self.build.cross_compilers]
- ninja_compdb = [ninja_exe, '-t', 'compdb'] + pch_compilers + native_compilers + cross_compilers
+ ninja_compdb = [self.ninja_command, '-t', 'compdb'] + pch_compilers + native_compilers + cross_compilers
builddir = self.environment.get_build_dir()
try:
jsondb = subprocess.check_output(ninja_compdb, cwd=builddir)
@@ -2566,11 +2568,8 @@ rule FORTRAN_DEP_HACK
default = 'default all\n\n'
outfile.write(default)
- ninja_command = environment.detect_ninja()
- if ninja_command is None:
- raise MesonException('Could not detect Ninja v1.6 or newer')
elem = NinjaBuildElement(self.all_outputs, 'meson-clean', 'CUSTOM_COMMAND', 'PHONY')
- elem.add_item('COMMAND', [ninja_command, '-t', 'clean'])
+ elem.add_item('COMMAND', [self.ninja_command, '-t', 'clean'])
elem.add_item('description', 'Cleaning.')
# Alias that runs the above-defined meson-clean target
self.create_target_alias('meson-clean', outfile)