cmGeneratorTarget: add a method to query if Fortran sources exist

This commit is contained in:
Ben Boeckel
2023-01-31 22:19:47 -05:00
parent 245a89d8b6
commit d19648a928
2 changed files with 11 additions and 0 deletions

View File

@@ -8860,6 +8860,15 @@ std::string cmGeneratorTarget::GenerateHeaderSetVerificationFile(
return filename;
}
bool cmGeneratorTarget::HaveFortranSources(std::string const& config) const
{
auto sources = cmGeneratorTarget::GetSourceFiles(config);
return std::any_of(sources.begin(), sources.end(),
[](BT<cmSourceFile*> const& sf) -> bool {
return sf.Value->GetLanguage() == "Fortran"_s;
});
}
bool cmGeneratorTarget::HaveCxx20ModuleSources() const
{
auto const& fs_names = this->Target->GetAllFileSetNames();

View File

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