mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-18 13:10:17 -06:00
cmLocalUnixMakefileGenerator3: handle object-referencing Fortran modules
Targets only using Fortran modules via `$<TARGET_OBJECTS>` also need a collation step to be performed. Check for this case and trigger the depends rule to be used.
This commit is contained in:
@@ -1899,6 +1899,11 @@ void cmLocalUnixMakefileGenerator3::WriteDependLanguageInfo(
|
||||
: "OFF")
|
||||
<< ")\n\n";
|
||||
|
||||
bool requireFortran = false;
|
||||
if (target->HaveFortranSources(this->GetConfigName())) {
|
||||
requireFortran = true;
|
||||
}
|
||||
|
||||
auto const& implicitLangs =
|
||||
this->GetImplicitDepends(target, cmDependencyScannerKind::CMake);
|
||||
|
||||
@@ -1908,6 +1913,12 @@ void cmLocalUnixMakefileGenerator3::WriteDependLanguageInfo(
|
||||
cmakefileStream << "set(CMAKE_DEPENDS_LANGUAGES\n";
|
||||
for (auto const& implicitLang : implicitLangs) {
|
||||
cmakefileStream << " \"" << implicitLang.first << "\"\n";
|
||||
if (requireFortran && implicitLang.first == "Fortran"_s) {
|
||||
requireFortran = false;
|
||||
}
|
||||
}
|
||||
if (requireFortran) {
|
||||
cmakefileStream << " \"Fortran\"\n";
|
||||
}
|
||||
cmakefileStream << " )\n";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user