Better Ninja detection.

pull/34/head
Jussi Pakkanen 11 years ago
parent 730a3f4213
commit 8771b1f49b
  1. 4
      environment.py
  2. 2
      ninjabackend.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()

@ -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')

Loading…
Cancel
Save