[build2] Generation of compilation databases on Linux

luizfernandoafrabrito at gmail.com luizfernandoafrabrito at gmail.com
Mon Sep 24 15:09:46 UTC 2018

I did try to apply your suggestion but it didn't work as well.

I don't know how bear works but I noted that b command outputs to stderr. Maybe this could be an issue?

I ended up using the following command to generate the compilation database:

$ b -v |& compiledb

where compiledb is a program that parses compilation commands.

On Sun, Sep 23, 2018 at 11:57:09PM +0200, Boris Kolpackov wrote:
>luizfernandoafrabrito at gmail.com <luizfernandoafrabrito at gmail.com> writes:
>> I'm amazed with build2 however I could not find how to generate a
>> compilation database (compile_commands.json) on Linux.
>Yes, this item is on our TODO list. We have all the information and
>should be able to generate it quite easily. Hopefully we will get to
>this soon.
>> I tried the following with build2:
>> $ bear b
>> but this generated an empty compile_commands.json
>I am not sure what's bear's problem with build2; maybe it's the
>fact that the build system itself is multi-threaded and issues
>compilation jobs simultaneously? Try to run it in the serial mode:
>$ bear b -s

More information about the users mailing list