Browse Source

FASTBuild: Disable caching and distribution in try_compile builds

This avoids hashing the whole toolchain and makes `try_compile` faster.
Eduard Voronkin 1 month ago
parent
commit
f6abf8044a
1 changed files with 4 additions and 0 deletions
  1. 4 0
      Source/cmGlobalFastbuildGenerator.cxx

+ 4 - 0
Source/cmGlobalFastbuildGenerator.cxx

@@ -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);