mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
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:
committed by
Brad King
parent
1dfe9898e6
commit
a8e64742aa
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user