logoalt Hacker News

jchw10/12/20242 repliesview on HN

Ninja and CMake do. It's especially useful if you want a compilation database for a project that takes an extremely long time to build.


Replies

wakawaka2810/12/2024

CMake does but I think you have to attempt a build to get the database. On the other hand I don't think that should be necessary, as it is capable of generating Ninja build files.

Almost nobody is writing Ninja files by hand. If you have to write something along those lines by hand, Makefiles would make more sense than Ninja. If Ninja does support exporting commands, it's a use case that doesn't matter because almost everyone uses CMake-generated Ninja files.

show 1 reply
ithkuil10/12/2024

Iirc there is also a bazel module that does that for bazel projects and only uses the query functionality without running an actual build