Recently I have been seeing long compile times. It started to be annoying at a point I investigated this and it turns out that single source change in one translation unit (.cpp file) causes lots of the source files of a library to be recompiled again and linked that is later on consumed by the executable (I scanned the outputs of a build running --debug switch).
Whatever .cpp file I change I see that this file + 22 other .cpp files (the same ones) are always being recompiled.
This makes compilation times terrible, up to a point that small change takes 1 minute to be recompiled and relinked.
I tried turning off various things in my project, including precompiled headers with no luck.
Example build scan - https://scans.gradle.com/s/au5a4kf6wopfk/ (here I touched 2 .cpp files but that does not matter a lot since again multiple files were recompiled causing long time to compile the library).
Is this normal behavior or my build is doing something bad? How do I even troubleshoot/fix such cases?