Skip to content

enable_language: Assume compiler works if ABI detection compiles

Brad King requested to merge brad.king/cmake:reduce-initial-checks into master

We run a try_compile with a tiny test source to check if the compiler works so that we can fail early if it does not. When the compiler does work, we immediately try_compile the ABI detection source. In the common case that both steps work, we gain no useful information from the first one and the work was wasted.

Re-order the checks to try the ABI detection first. If it works then assume the compiler works and skip the dedicated check. If the ABI check fails then proceed with the normal test for a working compiler so the diagnostic can be shown as before.

Fixes: #18703 (closed)

Merge request reports