summaryrefslogtreecommitdiffstats
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:47 (GMT)
commit6afe841e620f9149cd70821a952ec3a0460b8d3c (patch)
treebd9f098e2426d643ba45ba9394daf25492dd5b44
parentc1fc5455b192e2791010c4bec20b300c7652b712 (diff)
downloadCMake-6afe841e620f9149cd70821a952ec3a0460b8d3c.zip
CMake-6afe841e620f9149cd70821a952ec3a0460b8d3c.tar.gz
CMake-6afe841e620f9149cd70821a952ec3a0460b8d3c.tar.bz2
cmNinjaTargetGenerator: 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 collation rule to be added and used.
-rw-r--r--Source/cmNinjaTargetGenerator.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index dabb078..f6b51aa 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -1175,6 +1175,15 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements(
}
}
+ // Check if there are Fortran objects which need to participate in forwarding
+ // module requirements.
+ if (this->GeneratorTarget->HaveFortranSources(config) &&
+ !this->Configs[config].ScanningInfo.count("Fortran")) {
+ ScanningFiles files;
+ this->Configs[config].ScanningInfo["Fortran"].emplace_back(files);
+ this->WriteCompileRule("Fortran", config, WithScanning::Yes);
+ }
+
for (auto const& langScanningFiles : this->Configs[config].ScanningInfo) {
std::string const& language = langScanningFiles.first;
std::vector<ScanningFiles> const& scanningFiles = langScanningFiles.second;