Describe the bug, including details regarding any error messages, version, and platform.
I noticed the recent support for the mold linker, it currently adds the flags to the CMake compiler flags for C and C++ whereas it would be better to do this using the linker flags. I was going to create a PR to do that and this issue accompanies it.
This leads to less invalidation of cache when switching linkers as only the links would use the flag and is the more correct way to manipulate linker flags.
Component(s)
C++