|
|
|
@ -177,6 +177,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: |
|
|
|
@ -210,10 +213,9 @@ int dummy; |
|
|
|
|
|
|
|
|
|
# http://clang.llvm.org/docs/JSONCompilationDatabase.html |
|
|
|
|
def generate_compdb(self): |
|
|
|
|
ninja_exe = environment.detect_ninja() |
|
|
|
|
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'] + native_compilers + cross_compilers |
|
|
|
|
ninja_compdb = [self.ninja_command, '-t', 'compdb'] + native_compilers + cross_compilers |
|
|
|
|
builddir = self.environment.get_build_dir() |
|
|
|
|
try: |
|
|
|
|
jsondb = subprocess.check_output(ninja_compdb, cwd=builddir) |
|
|
|
@ -2509,11 +2511,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, '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.') |
|
|
|
|
|
|
|
|
|
# If we have custom targets in this project, add all their outputs to |
|
|
|
|