Makefiles: provide, but do not consume, "forward linked" target dirs

Makefiles do not have a per-object sense of where they come from, so
forwarding any module information here would end up with incorrect
module file path construction by consuming targets. Leave a TODO item in
its place.
This commit is contained in:
Ben Boeckel
2023-11-19 18:02:19 -05:00
committed by Brad King
parent 7cd0adab1b
commit a033dce326
2 changed files with 17 additions and 0 deletions

View File

@@ -258,6 +258,12 @@ bool cmDependsFortran::LocateModules()
}
this->MatchRemoteModules(fin, targetDir);
}
// TODO: Use `CMAKE_Fortran_TARGET_FORWARD_LINKED_INFO_FILES` to handle cases
// described in #25425. Note that because Makefiles generators do not
// implement relaxed object compilation as described in #15555, the issues
// never actually cause build failures; only incremental build incorrectness.
return true;
}

View File

@@ -1446,6 +1446,17 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
*this->InfoFileStream << " \"" << d << "/DependInfo.cmake\"\n";
}
*this->InfoFileStream << " )\n";
/* clang-format off */
*this->InfoFileStream
<< "\n"
"# Targets to which this target links which contain Fortran sources.\n"
"set(CMAKE_Fortran_TARGET_FORWARD_LINKED_INFO_FILES\n";
/* clang-format on */
for (std::string const& d : dirs.Forward) {
*this->InfoFileStream << " \"" << d << "/DependInfo.cmake\"\n";
}
*this->InfoFileStream << " )\n";
}
std::string const& working_dir =