ninja backend: do not fatally error on compdb failure

We print a warning if a compilation database isn't successfully
generated, which is good, because that gives some visibility in case the
user really wanted to use the compdb. But warnings default to being
fatal with --fatal-meson-warnings, which is not so good, because this
isn't a very important warning at all, and we'd rather not error out in
such cases when building works fine and a random bonus IDE feature
doesn't work.

Mark this particular warning as non-fatal.

Fixes side issue in https://github.com/mesonbuild/wrapdb/pull/343#issuecomment-1074545609
pull/10171/head
Eli Schwartz 3 years ago committed by Nirbheek Chauhan
parent 90fba42511
commit 7b78c6b41b
  1. 2
      mesonbuild/backend/ninjabackend.py

@ -606,7 +606,7 @@ class NinjaBackend(backends.Backend):
with open(os.path.join(builddir, 'compile_commands.json'), 'wb') as f: with open(os.path.join(builddir, 'compile_commands.json'), 'wb') as f:
f.write(jsondb) f.write(jsondb)
except Exception: except Exception:
mlog.warning('Could not create compilation database.') mlog.warning('Could not create compilation database.', fatal=False)
# Get all generated headers. Any source file might need them so # Get all generated headers. Any source file might need them so
# we need to add an order dependency to them. # we need to add an order dependency to them.

Loading…
Cancel
Save