Regression: CMake 3.27.0..3.28.0-rc3: Fortran + Ninja with TARGET_OBJECTS
While !8645 (merged) fixed target_link_libraries
for Fortran OBJECT libraries with Ninja in CMake 3.27.5, there is another bug introduced in CMake 3.27.0 that is not yet fixed and persists through CMake 3.28.0-rc3. I have made a Gist: https://gist.github.com/scivision/d42cb497e33a3a7318900728937e77a4
The issue is that dependencies are not being tracked with TARGET_OBJECTS properly, resulting in build errors about missing ".mod" files because dependencies aren't being respected with TARGET_OBJECTS. This is just like #25112 (closed)
I include in that Gist build.ninja from CMake 3.26.5 and CMake 3.27.7 and there are clear differences in the dependencies.
This problem is just like #25112 (closed) with the difference being the use of TARGET_OBJECTS
which is vital for bigger Fortran programs that need to use Object libraries for auxiliary non-installed target.