mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-08 14:50:10 -06:00
Merge branch 'fortran-object-libraries-release' into fortran-object-libraries
* fortran-object-libraries-release: cmComputeLinkInformation: compute link info for module-using targets cmGeneratorTarget: support config-independent Fortran source queries
This commit is contained in:
@@ -538,11 +538,14 @@ cmComputeLinkInformation::GetSharedLibrariesLinked() const
|
||||
|
||||
bool cmComputeLinkInformation::Compute()
|
||||
{
|
||||
// Skip targets that do not link.
|
||||
// Skip targets that do not link or have link-like information consumers may
|
||||
// need (namely modules).
|
||||
if (!(this->Target->GetType() == cmStateEnums::EXECUTABLE ||
|
||||
this->Target->GetType() == cmStateEnums::SHARED_LIBRARY ||
|
||||
this->Target->GetType() == cmStateEnums::MODULE_LIBRARY ||
|
||||
this->Target->GetType() == cmStateEnums::STATIC_LIBRARY)) {
|
||||
this->Target->GetType() == cmStateEnums::STATIC_LIBRARY ||
|
||||
this->Target->HaveCxx20ModuleSources() ||
|
||||
this->Target->HaveFortranSources())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -9042,6 +9042,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(std::string* errorMessage) const
|
||||
{
|
||||
auto const& fs_names = this->Target->GetAllFileSetNames();
|
||||
|
||||
@@ -1262,6 +1262,7 @@ public:
|
||||
cmGeneratorTarget const* t2) const;
|
||||
};
|
||||
|
||||
bool HaveFortranSources() const;
|
||||
bool HaveFortranSources(std::string const& config) const;
|
||||
|
||||
// C++20 module support queries.
|
||||
|
||||
Reference in New Issue
Block a user