diff options
author | Brad King <brad.king@kitware.com> | 2020-07-21 17:22:26 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-07-23 17:31:45 (GMT) |
commit | 2f0790df5046bfc99383317eb7d24cd4030200be (patch) | |
tree | 60362de080828e4b1b4fcd849b2d3e07ac157a42 /Source/cmGlobalGenerator.cxx | |
parent | 422d9a0ab21ff430e5fd012cf965dd92068d185f (diff) | |
download | CMake-2f0790df5046bfc99383317eb7d24cd4030200be.zip CMake-2f0790df5046bfc99383317eb7d24cd4030200be.tar.gz CMake-2f0790df5046bfc99383317eb7d24cd4030200be.tar.bz2 |
Factor out generator checks for filtering on non-compiling targets
Add a `cmGeneratorTarget::CanCompileSources` helper method to tell
generators whether a target might compile anything.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index b79dfde..ac94a28 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -302,9 +302,7 @@ bool cmGlobalGenerator::CheckTargetsForMissingSources() const bool failed = false; for (const auto& localGen : this->LocalGenerators) { for (const auto& target : localGen->GetGeneratorTargets()) { - if (target->GetType() == cmStateEnums::TargetType::GLOBAL_TARGET || - target->GetType() == cmStateEnums::TargetType::INTERFACE_LIBRARY || - target->GetType() == cmStateEnums::TargetType::UTILITY || + if (!target->CanCompileSources() || cmIsOn(target->GetProperty("ghs_integrity_app"))) { continue; } @@ -358,9 +356,7 @@ bool cmGlobalGenerator::CheckTargetsForPchCompilePdb() const bool failed = false; for (const auto& generator : this->LocalGenerators) { for (const auto& target : generator->GetGeneratorTargets()) { - if (target->GetType() == cmStateEnums::TargetType::GLOBAL_TARGET || - target->GetType() == cmStateEnums::TargetType::INTERFACE_LIBRARY || - target->GetType() == cmStateEnums::TargetType::UTILITY || + if (!target->CanCompileSources() || cmIsOn(target->GetProperty("ghs_integrity_app"))) { continue; } @@ -1595,9 +1591,7 @@ bool cmGlobalGenerator::AddAutomaticSources() for (const auto& lg : this->LocalGenerators) { lg->CreateEvaluationFileOutputs(); for (const auto& gt : lg->GetGeneratorTargets()) { - if (gt->GetType() == cmStateEnums::INTERFACE_LIBRARY || - gt->GetType() == cmStateEnums::UTILITY || - gt->GetType() == cmStateEnums::GLOBAL_TARGET) { + if (!gt->CanCompileSources()) { continue; } lg->AddUnityBuild(gt.get()); @@ -1609,9 +1603,7 @@ bool cmGlobalGenerator::AddAutomaticSources() } for (const auto& lg : this->LocalGenerators) { for (const auto& gt : lg->GetGeneratorTargets()) { - if (gt->GetType() == cmStateEnums::INTERFACE_LIBRARY || - gt->GetType() == cmStateEnums::UTILITY || - gt->GetType() == cmStateEnums::GLOBAL_TARGET) { + if (!gt->CanCompileSources()) { continue; } // Handle targets that re-use a PCH from an above-handled target. |