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:47 (GMT) |
commit | 6afe841e620f9149cd70821a952ec3a0460b8d3c (patch) | |
tree | bd9f098e2426d643ba45ba9394daf25492dd5b44 | |
parent | c1fc5455b192e2791010c4bec20b300c7652b712 (diff) | |
download | CMake-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.cxx | 9 |
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; |