The recompilation cascade issue and its solutions

I think theoretically, it should be possible to avoid recompilation in that case. There is a short discussion on this topic in Build systems that know when to recompile -- revised

2 Likes