try_compile: Tolerate compile features from non-enabled languages

Do not copy the list of enabled languages from the outer generator.
It is populated as languages are enabled inside the test project.

Fixes: #27684
7 files changed