Compiler doesn't detect changes in include files

It appears that one needs to use force_recompile = TRUE if a change is made in any included files. Would it be possible to have the Stan compiler traverse the who include dependency tree to see if any file changed?

Cmdstanpy detects this but it’s not clear to me how you could have the more general Stan build system do it

Perhaps cmdstanr can do something similar?