Makefile: Fortran dependency scanning breaks on pre-processor directive in line-continued USE statement
We're using the Fypp pre-processor in our project at https://github.com/cp2k/dbcsr together with cmake. Everything works fine unless we want the pre-processor line number information to match compilation errors. As soon as we enable them in Fypp, cmake's Fortran parser fails to generate the proper dependencies for some of the files. The problematic files contain something like the following after pre-processing with Fypp:
MODULE dbcsr_list
USE dbcsr_timings_base_type, ONLY: routine_report_type, callstack_entry_type, routine_stat_type
USE dbcsr_list_callstackentry, ONLY: list_callstackentry_type, list_callstackentry_init, list_callstackentry_push,&
# 26 "dbcsr_list.F"
& list_callstackentry_pop, list_callstackentry_peek, list_callstackentry_insert, list_callstackentry_set,&
# 26 "dbcsr_list.F"
& list_callstackentry_get, list_callstackentry_del, list_callstackentry_clear, list_callstackentry_size,&
# 26 "dbcsr_list.F"
& list_callstackentry_destroy, list_callstackentry_isready
USE dbcsr_list_routinereport, ONLY: list_routinereport_type, list_routinereport_init, list_routinereport_push,&
# 27 "dbcsr_list.F"
& list_routinereport_pop, list_routinereport_peek, list_routinereport_insert, list_routinereport_set, list_routinereport_get,&
# 27 "dbcsr_list.F"
& list_routinereport_del, list_routinereport_clear, list_routinereport_size, list_routinereport_destroy,&
# 27 "dbcsr_list.F"
& list_routinereport_isready
USE dbcsr_list_routinestat, ONLY: list_routinestat_type, list_routinestat_init, list_routinestat_push,&
# 28 "dbcsr_list.F"
& list_routinestat_pop, list_routinestat_peek, list_routinestat_insert, list_routinestat_set, list_routinestat_get,&
# 28 "dbcsr_list.F"
& list_routinestat_del, list_routinestat_clear, list_routinestat_size, list_routinestat_destroy, list_routinestat_isready
USE dbcsr_list_timerenv, ONLY: list_timerenv_type, list_timerenv_init, list_timerenv_push, list_timerenv_pop,&
# 29 "dbcsr_list.F"
& list_timerenv_peek, list_timerenv_insert, list_timerenv_set, list_timerenv_get, list_timerenv_del, list_timerenv_clear,&
# 29 "dbcsr_list.F"
& list_timerenv_size, list_timerenv_destroy, list_timerenv_isready
After reading issues like #17398 I guess this is something which should be fixed with ninja, but still reporting here with the hopes of getting a workaround.