[Scons-users] Ninja generator, compilation database issues

Jelic, Nikola Nikola.Jelic at zuehlke.com
Fri Aug 30 04:38:17 EDT 2024


Greetings,

We are using SCons' Ninja generator to upgrade the existing project. We are also using the compilation database extension in SCons, but we have reached some interesting limitations when we try to use Ninja generator.
In short, if "compile_commands.json" is requested to be anywhere except the root of the project (which is not our case), we face one or all of these issues:

  *
Duplicate Ninja targets
  *
A hanging task for generating the compilation database on a different location

I have a small WIP patch that resolves some of these issues, but I wanted to start a discussion and see what the best approach would be.

The points I have so far:

  *
Compilation database can be generated from SCons or from Ninja independently, as it is an open format
  *
Ninja doesn't have to invoke SCons to generate the compilation database
  *
The location and the name of the compilation database file should be completely independent of the project structure

Kind regards,

Nikola Jelić
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20240830/cd78a17f/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Generated-ninja-file-doesn-t-have-the-duplicated-com.patch
Type: application/octet-stream
Size: 3276 bytes
Desc: 0002-Generated-ninja-file-doesn-t-have-the-duplicated-com.patch
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20240830/cd78a17f/attachment.obj>


More information about the Scons-users mailing list