Warn about bad compilers earlier
Before this change, users could run into issues such as not finding support for std::filesystem before running into our errors and warnings that their compiler is not going to work at all. Afterwards they get the most important information first.
Fixes #5056 (closed)