On Fri, Dec 20, 2019 at 12:02:17 -0500, Robb Matzke wrote:
> Out of curiosity and since the OP is comparing Tup with CMake, do you
> have any experience with CMake+Ninja compiling generated source code?
They're comparing it with hand-written Makefiles I believe, not CMake
specifically.
> For instance, my project has some large C++ files that get generated as
> part of the build process, and those source files #include additional
> project headers, some of which might also be generated. In fact, the
> generator itself is built as part of the project. Does CMake + Ninja
> discover that the generated C++ files depend on certain headers so that
> if I change one of the headers then the generated C++ gets recompiled
> without necessarily regenerating it first? In other words, does
> CMake+Ninja run the dependency-discovery step just once at the beginning
> (before generated files are generated) or does it know to run the
> dependency-discovery during the build whenever source is newly generated?
In all the generators, dependencies of sources are discovered at build
time. Ninja uses `-MD` or `/showIncludes`. For historical reasons, the
Makefiles generators use a built-in mechanism by CMake that is only
inaccurate in that it overguesses if anything (there is a plan for
updating them to work like Ninja, but that isn't on a schedule yet). The
IDE generators do what the IDEs do, but have the same behavior if not
mechanism.
I recommend further CMake-specific discussion on the CMake Discourse
rather than on the Tup list.
https://discourse.cmake.org/
--Ben