Why are some units re-compiled? lazarus / 21-General ---------------------------------------------------------------------- jollytall · 2022-03-03 06:09 I am using Lazarus and compile the projects with F9, or Ctrl-F9. Normally when I compile a project only those units are re-compiled that have been changed. This is logic. Sometimes I notice (this time with generics.collections) that a unit is re-compiled when the unit itself is not changed, but where it is in the uses changes. So, when I make a small change in my unit then the whole generics.collections is re-compiled slowing down the compilation (and btw. also throwing hints, warnings and notes). Why is this? ---------------------------------------------------------------------- WooBean · 2022-03-03 07:05 Hi, IMO when some unit or program changes its "uses" clause (including other unit) then its environment (compiler directives and application settings) must apply to unit which has not changed itself but generated code (unit.ppu, unit.o) will be different according to global settings. That is why. ---------------------------------------------------------------------- PascalDragon · 2022-03-03 08:02 Quote from: jollytall on March 03, 2022, 07:09:06 amSometimes I notice (this time with generics.collections) that a unit is re-compiled when the unit itself is not changed, but where it is in the uses changes. So, when I make a small change in my unit then the whole generics.collections is re-compiled slowing down the compilation (and btw. also throwing hints, warnings and notes). Why is this? This is not Generics.Collections being recompiled, but the generics that you use from that unit (aka the specializations) inside your own unit being recompiled. And when a generic generates a warning, hint, etc. then this will also be repeated during the specialization. ---------------------------------------------------------------------- jollytall · 2022-03-03 09:50 I see, thanks.