diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2016-10-31 13:17:59 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2016-11-02 13:48:24 -0700 |
commit | 72995b58004f8966ff55fb604787772c5f43d8a4 (patch) | |
tree | 215576a2ad071f110aae90a015c16fbe48aec9f9 | |
parent | 69aa0091b1efa61b1152fb2eb981f0be628d4a1b (diff) | |
download | meson-72995b58004f8966ff55fb604787772c5f43d8a4.zip meson-72995b58004f8966ff55fb604787772c5f43d8a4.tar.gz meson-72995b58004f8966ff55fb604787772c5f43d8a4.tar.bz2 |
Do not error out if compdb can not be created.
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 6 |
1 files changed, 3 insertions, 3 deletions
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. |