cmComputeLinkInformation: compute link info for module-using targets

Targets which contain C++ module or Fortran sources need to participate
in link information unconditionally regardless of whether they actually
have link artifacts or not.

Fixes: #25223
This commit is contained in:
Ben Boeckel
2023-09-05 15:56:03 -04:00
parent 6251edaed1
commit 74b1d6caf3

View File

@@ -533,11 +533,14 @@ cmComputeLinkInformation::GetObjectLibrariesLinked() 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;
}