mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-21 23:00:50 +08:00
cmDependsFortran: require that dependency info files work
Now that only targets expected to have information are listed, all `DependInfo.cmake` files should exist.
This commit is contained in:
@@ -150,7 +150,9 @@ bool cmDependsFortran::Finalize(std::ostream& makeDepends,
|
|||||||
std::ostream& internalDepends)
|
std::ostream& internalDepends)
|
||||||
{
|
{
|
||||||
// Prepare the module search process.
|
// Prepare the module search process.
|
||||||
this->LocateModules();
|
if (!this->LocateModules()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Get the directory in which stamp files will be stored.
|
// Get the directory in which stamp files will be stored.
|
||||||
const std::string& stamp_dir = this->TargetDirectory;
|
const std::string& stamp_dir = this->TargetDirectory;
|
||||||
@@ -216,7 +218,7 @@ bool cmDependsFortran::Finalize(std::ostream& makeDepends,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmDependsFortran::LocateModules()
|
bool cmDependsFortran::LocateModules()
|
||||||
{
|
{
|
||||||
// Collect the set of modules provided and required by all sources.
|
// Collect the set of modules provided and required by all sources.
|
||||||
using ObjectInfoMap = cmDependsFortranInternals::ObjectInfoMap;
|
using ObjectInfoMap = cmDependsFortranInternals::ObjectInfoMap;
|
||||||
@@ -234,7 +236,7 @@ void cmDependsFortran::LocateModules()
|
|||||||
|
|
||||||
// Short-circuit for simple targets.
|
// Short-circuit for simple targets.
|
||||||
if (this->Internal->TargetRequires.empty()) {
|
if (this->Internal->TargetRequires.empty()) {
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Match modules provided by this target to those it requires.
|
// Match modules provided by this target to those it requires.
|
||||||
@@ -248,10 +250,14 @@ void cmDependsFortran::LocateModules()
|
|||||||
std::string targetDir = cmSystemTools::GetFilenamePath(i);
|
std::string targetDir = cmSystemTools::GetFilenamePath(i);
|
||||||
std::string fname = targetDir + "/fortran.internal";
|
std::string fname = targetDir + "/fortran.internal";
|
||||||
cmsys::ifstream fin(fname.c_str());
|
cmsys::ifstream fin(fname.c_str());
|
||||||
if (fin) {
|
if (!fin) {
|
||||||
this->MatchRemoteModules(fin, targetDir);
|
cmSystemTools::Error(cmStrCat("-E cmake_depends failed to open ", fname,
|
||||||
|
" for module information"));
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
this->MatchRemoteModules(fin, targetDir);
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmDependsFortran::MatchLocalModules()
|
void cmDependsFortran::MatchLocalModules()
|
||||||
|
@@ -55,7 +55,7 @@ protected:
|
|||||||
std::ostream& internalDepends) override;
|
std::ostream& internalDepends) override;
|
||||||
|
|
||||||
// Find all the modules required by the target.
|
// Find all the modules required by the target.
|
||||||
void LocateModules();
|
bool LocateModules();
|
||||||
void MatchLocalModules();
|
void MatchLocalModules();
|
||||||
void MatchRemoteModules(std::istream& fin, const std::string& stampDir);
|
void MatchRemoteModules(std::istream& fin, const std::string& stampDir);
|
||||||
void ConsiderModule(const std::string& name, const std::string& stampDir);
|
void ConsiderModule(const std::string& name, const std::string& stampDir);
|
||||||
|
Reference in New Issue
Block a user