summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2023-09-05 19:55:19 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2023-09-05 22:12:25 (GMT)
commit6251edaed1c4f55625d96dc31e044a9fd23e1db2 (patch)
tree3add475d2a695d9a17c718c3023539e5fe5b11e9 /Source
parent8708b41532a01479a96b2d5a67e54b7a1397306f (diff)
downloadCMake-6251edaed1c4f55625d96dc31e044a9fd23e1db2.zip
CMake-6251edaed1c4f55625d96dc31e044a9fd23e1db2.tar.gz
CMake-6251edaed1c4f55625d96dc31e044a9fd23e1db2.tar.bz2
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).
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGeneratorTarget.cxx9
-rw-r--r--Source/cmGeneratorTarget.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 357d0a6..7d1fcf3 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -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();
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 78945c3..dca69fd 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -1247,6 +1247,7 @@ public:
cmGeneratorTarget const* t2) const;
};
+ bool HaveFortranSources() const;
bool HaveFortranSources(std::string const& config) const;
// C++20 module support queries.