From 72995b58004f8966ff55fb604787772c5f43d8a4 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Mon, 31 Oct 2016 13:17:59 +0200 Subject: Do not error out if compdb can not be created. --- mesonbuild/backend/ninjabackend.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mesonbuild') diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index dd0143c..add7dcc 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -212,10 +212,10 @@ int dummy; builddir = self.environment.get_build_dir() try: jsondb = subprocess.check_output([ninja_exe, '-t', 'compdb', 'c_COMPILER', 'cpp_COMPILER'], cwd=builddir) + with open(os.path.join(builddir, 'compile_commands.json'), 'wb') as f: + f.write(jsondb) except Exception: - raise MesonException('Could not create compilation database.') - with open(os.path.join(builddir, 'compile_commands.json'), 'wb') as f: - f.write(jsondb) + mlog.log(mlog.red('Warning:', 'Could not create compilation database.')) # Get all generated headers. Any source file might need them so # we need to add an order dependency to them. -- cgit v1.1