aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2014-11-24 18:41:41 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2014-11-24 18:41:41 +0200
commit8771b1f49b5900731fc08d533d2cc20b1c20d995 (patch)
tree31dce557ea79926ac4813441237cabaf2b8ec0c1
parent730a3f4213aee6a063f8039c5155f1a52861b703 (diff)
downloadmeson-8771b1f49b5900731fc08d533d2cc20b1c20d995.zip
meson-8771b1f49b5900731fc08d533d2cc20b1c20d995.tar.gz
meson-8771b1f49b5900731fc08d533d2cc20b1c20d995.tar.bz2
Better Ninja detection.
-rw-r--r--environment.py4
-rw-r--r--ninjabackend.py2
2 files changed, 2 insertions, 4 deletions
diff --git a/environment.py b/environment.py
index 4ae5922..58d0219 100644
--- a/environment.py
+++ b/environment.py
@@ -1507,10 +1507,8 @@ def find_valgrind():
def detect_ninja():
for n in ['ninja', 'ninja-build']:
- # Plain 'ninja' or 'ninja -h' yields an error
- # code. Thanks a bunch, guys.
try:
- p = subprocess.Popen([n, '-t', 'list'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
+ p = subprocess.Popen([n, '--version'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
except FileNotFoundError:
continue
p.communicate()
diff --git a/ninjabackend.py b/ninjabackend.py
index ed93513..bedea27 100644
--- a/ninjabackend.py
+++ b/ninjabackend.py
@@ -1392,7 +1392,7 @@ rule FORTRAN_DEP_HACK
ninja_command = environment.detect_ninja()
if ninja_command is None:
- raise RuntimeError('Could not detect ninja command')
+ raise MesonException('Could not detect ninja command')
elem = NinjaBuildElement('clean', 'CUSTOM_COMMAND', 'PHONY')
elem.add_item('COMMAND', [ninja_command, '-t', 'clean'])
elem.add_item('description', 'Cleaning')