diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-11-19 23:02:19 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-11-23 19:26:31 (GMT) |
commit | a033dce326016c304a299fa51b8c13b9f832c8d0 (patch) | |
tree | bfe8854d3a240808a61050246b6c8c143415c246 | |
parent | 7cd0adab1b0149fe227c4eda3bd085e2d1f4dd52 (diff) | |
download | CMake-a033dce326016c304a299fa51b8c13b9f832c8d0.zip CMake-a033dce326016c304a299fa51b8c13b9f832c8d0.tar.gz CMake-a033dce326016c304a299fa51b8c13b9f832c8d0.tar.bz2 |
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.
-rw-r--r-- | Source/cmDependsFortran.cxx | 6 | ||||
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 11 |
2 files changed, 17 insertions, 0 deletions
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 = |