Yuao Ma via Gcc <gcc@gcc.gnu.org> writes:

> Hello GCC developers,
> I am trying to generate a compile_commands.json file for the GCC source code. 
> This file is very useful for various development tools and IDE integrations.
> Since GCC uses a Makefile-based build system, I attempted to use bear 
> (https://github.com/rizsotto/Bear) to capture the compilation commands. My 
> workflow was as follows:

What version of bear did you use? You'll need >=3.1.6 as that contains
https://github.com/rizsotto/Bear/commit/c18c8eef1e74bd253302d57dbcf908394566d93b.

>
> ../configure --enable-languages=c,c++,fortran --disable-bootstrap 
> --disable-multilib
> bear -- make -j$(nproc)
>
>
> However, this approach did not produce the expected compile_commands.json 
> file with the correct compilation commands for the source files.

Did you get one generated at all? If so, what was missing, or what was
wrong with it?

Reply via email to