summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2023-11-18 03:51:47 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2023-11-21 14:43:49 (GMT)
commitf8729ab3667c695a734df0164cca692393bb6810 (patch)
tree51fa4cf01ae486044eb60fc5d45242edf6ae5feb /Source
parent6afe841e620f9149cd70821a952ec3a0460b8d3c (diff)
downloadCMake-f8729ab3667c695a734df0164cca692393bb6810.zip
CMake-f8729ab3667c695a734df0164cca692393bb6810.tar.gz
CMake-f8729ab3667c695a734df0164cca692393bb6810.tar.bz2
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.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index e26a6ea..7bce1d2 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -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";