Merge topic 'FASTBuild-optimize-try_compile' into release-4.2

f6abf8044a FASTBuild: Disable caching and distribution in try_compile builds

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11365
This commit is contained in:
Brad King 2025-10-28 13:39:59 +00:00 committed by Kitware Robot
commit 37d7b9820e

View File

@ -893,6 +893,10 @@ void cmGlobalFastbuildGenerator::WriteCompilers()
}
WriteVariable("Executable", Quote(compilerPath), 1);
WriteVariable("CompilerFamily", Quote(compilerDef.CompilerFamily), 1);
if (this->GetCMakeInstance()->GetIsInTryCompile()) {
WriteVariable("AllowCaching", "false", 1);
WriteVariable("AllowDistribution", "false", 1);
}
if (compilerDef.UseLightCache && compilerDef.CompilerFamily == "msvc") {
WriteVariable("UseLightCache_Experimental", "true", 1);