mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
cmCommonTargetGenerator: use modules from object-referenced targets
Fortran modules provided by objects added as sources via `$<TARGET_OBJECTS>` should also be considered as "linked targets" for collation purposes. As C++ modules have their own visibility rules through their `FILE_SET` feature, do not expose these for C++ module collation.
This commit is contained in:
@@ -201,6 +201,14 @@ std::vector<std::string> cmCommonTargetGenerator::GetLinkedTargetDirectories(
|
||||
for (cmGeneratorTarget const* target : cli->GetExternalObjectTargets()) {
|
||||
addLinkedTarget(target);
|
||||
}
|
||||
if (lang == "Fortran"_s) {
|
||||
// Fortran modules provided by `$<TARGET_OBJECTS>` as sources should be
|
||||
// collated for use in this target.
|
||||
for (cmGeneratorTarget const* target :
|
||||
this->GeneratorTarget->GetSourceObjectLibraries(config)) {
|
||||
addLinkedTarget(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
return dirs;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user