`cmake -E cmake_depends "Unix Makefiles"` crashes when Fortran source #includes itself
I use the construct of a Fortran source file #including itself via the C preprocessor to avoid dual implementations of real and complex versions of a function. With a few extra preprocessor macros, this works just fine. (The C preprocessor is called internally by Fortran compilers when a source file has the .F90
extension, with the capital "F".)
I found out that the Cmake's internal call to cmake -E cmake_depends "Unix Makefiles"
chokes on this construct, but only on some platforms. By "chokes", I mean it crashes on some platforms and enters an infinite loop on other platforms. On yet other platforms, there is no issue at all. The different behavior is observed for the exact same Cmake version, 3.18.0 in particular (though it may be compiled differently on the different platforms).
Before I make the effort to make a minimal working example, doesn't someone have a guess what could cause it? And even better whether it could be somehow circumvented even with the older Cmake versions without discontinuing my preprocessor trick?