diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-11-18 03:51:47 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2023-11-21 14:43:49 (GMT) |
commit | f8729ab3667c695a734df0164cca692393bb6810 (patch) | |
tree | 51fa4cf01ae486044eb60fc5d45242edf6ae5feb /Source | |
parent | 6afe841e620f9149cd70821a952ec3a0460b8d3c (diff) | |
download | CMake-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.cxx | 11 |
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"; |