cmGeneratorTarget: support config-independent Fortran source queries

Some locations care about "any config with Fortran", so make a query for
such (they may not know any configuration names themselves).
This commit is contained in:
Ben Boeckel
2023-09-05 15:55:19 -04:00
parent 8708b41532
commit 6251edaed1
2 changed files with 10 additions and 0 deletions

View File

@@ -8873,6 +8873,15 @@ bool cmGeneratorTarget::HaveFortranSources(std::string const& config) const
});
}
bool cmGeneratorTarget::HaveFortranSources() const
{
auto sources = cmGeneratorTarget::GetAllConfigSources();
return std::any_of(sources.begin(), sources.end(),
[](AllConfigSource const& sf) -> bool {
return sf.Source->GetLanguage() == "Fortran"_s;
});
}
bool cmGeneratorTarget::HaveCxx20ModuleSources() const
{
auto const& fs_names = this->Target->GetAllFileSetNames();

View File

@@ -1247,6 +1247,7 @@ public:
cmGeneratorTarget const* t2) const;
};
bool HaveFortranSources() const;
bool HaveFortranSources(std::string const& config) const;
// C++20 module support queries.