Skip to content

Commit

Permalink
ninja backend: do not fatally error on compdb failure
Browse files Browse the repository at this point in the history
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 mesonbuild/wrapdb#343 (comment)
  • Loading branch information
eli-schwartz authored and nirbheek committed Mar 23, 2022
1 parent 6b26d79 commit 2000ece
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mesonbuild/backend/ninjabackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ def generate_compdb(self):
with open(os.path.join(builddir, 'compile_commands.json'), 'wb') as f:
f.write(jsondb)
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
# we need to add an order dependency to them.
Expand Down

0 comments on commit 2000ece

Please sign in to comment.