From a033dce326016c304a299fa51b8c13b9f832c8d0 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sun, 19 Nov 2023 18:02:19 -0500 Subject: 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. --- Source/cmDependsFortran.cxx | 6 ++++++ Source/cmMakefileTargetGenerator.cxx | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index 2a50565..b23dabd 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -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; } diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 3ad0928..74b4b75 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -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 = -- cgit v0.12