CMake/Tests/FortranModules/Library
Brad King 01d7860fdb Ninja,Makefile: Restore Fortran module scanning in static library cycle
Since

* commit eed295fd8a (cmGlobalNinjaGenerator: require that dependency info
                     files work, 2023-02-01, v3.26.0-rc1~1^2~1), and
* commit 13810dee17 (cmDependsFortran: require that dependency info files
                     work, 2023-02-01, v3.26.0-rc1~1^2),

the Ninja and Makefile generators' module dependency scanning requires
that scanning results from from linked targets is available before
scanning the current target.  In the case of a static library cycle,
we cannot expect this information from other static libraries in the
cycle.  Previously we supported cyclic cases at the cost of silently
ignoring missing information.

We already compute a global order of targets that respects all
`add_dependencies`, but may break `target_link_libraries` dependencies
that occur in a static library cycle.  Use this order to filter the
linked targets so we only expect scanning results to be available from
those targets that build before the current target.

This approach is sufficient to support module dependency scanning in
static library cycles as long as module dependencies do not cross
between two libraries in the same cycle.

Fixes: #24631
2023-03-24 15:57:52 -04:00
..
a.f90
b.f90
CMakeLists.txt Ninja,Makefile: Restore Fortran module scanning in static library cycle 2023-03-24 15:57:52 -04:00
cycleA1.f90 Ninja,Makefile: Restore Fortran module scanning in static library cycle 2023-03-24 15:57:52 -04:00
cycleA2.f90 Ninja,Makefile: Restore Fortran module scanning in static library cycle 2023-03-24 15:57:52 -04:00
cycleB1.f90 Ninja,Makefile: Restore Fortran module scanning in static library cycle 2023-03-24 15:57:52 -04:00
cycleB2.f90 Ninja,Makefile: Restore Fortran module scanning in static library cycle 2023-03-24 15:57:52 -04:00
main.f90