FASTBuild: allow disabling of caching / distribution

Compilation is complicated. Caching / distribution is even more
complicated. Sometimes there are bugs (in compilers as well as in
FASTBuild), so export the option to disable those features for CMake
targets.
This commit is contained in:
Eduard Voronkin
2025-08-28 12:33:22 -07:00
committed by Brad King
parent 1dfe9898e6
commit a8e64742aa
17 changed files with 107 additions and 0 deletions

View File

@@ -1220,6 +1220,13 @@ cmFastbuildNormalTargetGenerator::GenerateObjects()
std::string const staticCheckOptions = ComputeCodeCheckOptions(srcFile);
auto const isDisabled = [this](char const* prop) {
auto const propValue = this->GeneratorTarget->GetProperty(prop);
return propValue && propValue.IsOff();
};
bool const disableCaching = isDisabled("FASTBUILD_CACHING");
bool const disableDistribution = isDisabled("FASTBUILD_DISTRIBUTION");
for (auto const& arch : this->GetArches()) {
std::string const compileOptions = GetCompileOptions(srcFile, arch);
@@ -1261,6 +1268,12 @@ cmFastbuildNormalTargetGenerator::GenerateObjects()
if (!objectListNode.CompilerOptions.empty()) {
continue;
}
if (disableCaching) {
objectListNode.AllowCaching = false;
}
if (disableDistribution) {
objectListNode.AllowDistribution = false;
}
objectListNode.CompilerOutputPath = objOutDirWithPossibleSubdir;
LogMessage(cmStrCat("Output path: ", objectListNode.CompilerOutputPath));