Ninja: Dependency issue with generated sources and Unity Build
There seems to be an issue with generated sources being part of a unity chunk. Running the given example for the first time, everything works as expected. foo.cpp gets generated, the unity object gets compiled and the baz library linked.
In the second run I change/touch the bar.cpp and run the build again. This time only the foo.cpp gets generated and the build is done. An additional build run compiles the unity object and links the lib.
The expected behavior can be reproduced just with gcc and ninja. If also tested MSVC and ninja, which works fine, and gcc with GNU Make, which also works fine.
Right now I don't know if this is a CMake issue inside the ninja generator or an issue within ninja itself. So I'm starting at the top.
Edited by Brad King