diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-02-01 14:12:22 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2023-02-01 14:13:51 (GMT) |
commit | 13810dee17794c5d57845e5a7a0b38b4204dd734 (patch) | |
tree | ff4d1d8438fd34a450b6b6a9b7b355b7a04c6ace | |
parent | eed295fd8a84f4a4919acf2893053ad7e52e656d (diff) | |
download | CMake-13810dee17794c5d57845e5a7a0b38b4204dd734.zip CMake-13810dee17794c5d57845e5a7a0b38b4204dd734.tar.gz CMake-13810dee17794c5d57845e5a7a0b38b4204dd734.tar.bz2 |
cmDependsFortran: require that dependency info files work
Now that only targets expected to have information are listed, all
`DependInfo.cmake` files should exist.
-rw-r--r-- | Source/cmDependsFortran.cxx | 16 | ||||
-rw-r--r-- | Source/cmDependsFortran.h | 2 |
2 files changed, 12 insertions, 6 deletions
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index 95f2a6b..718097f 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -150,7 +150,9 @@ bool cmDependsFortran::Finalize(std::ostream& makeDepends, std::ostream& internalDepends) { // Prepare the module search process. - this->LocateModules(); + if (!this->LocateModules()) { + return false; + } // Get the directory in which stamp files will be stored. const std::string& stamp_dir = this->TargetDirectory; @@ -216,7 +218,7 @@ bool cmDependsFortran::Finalize(std::ostream& makeDepends, return true; } -void cmDependsFortran::LocateModules() +bool cmDependsFortran::LocateModules() { // Collect the set of modules provided and required by all sources. using ObjectInfoMap = cmDependsFortranInternals::ObjectInfoMap; @@ -234,7 +236,7 @@ void cmDependsFortran::LocateModules() // Short-circuit for simple targets. if (this->Internal->TargetRequires.empty()) { - return; + return true; } // 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 fname = targetDir + "/fortran.internal"; cmsys::ifstream fin(fname.c_str()); - if (fin) { - this->MatchRemoteModules(fin, targetDir); + if (!fin) { + cmSystemTools::Error(cmStrCat("-E cmake_depends failed to open ", fname, + " for module information")); + return false; } + this->MatchRemoteModules(fin, targetDir); } + return true; } void cmDependsFortran::MatchLocalModules() diff --git a/Source/cmDependsFortran.h b/Source/cmDependsFortran.h index a74db91..763f7bb 100644 --- a/Source/cmDependsFortran.h +++ b/Source/cmDependsFortran.h @@ -55,7 +55,7 @@ protected: std::ostream& internalDepends) override; // Find all the modules required by the target. - void LocateModules(); + bool LocateModules(); void MatchLocalModules(); void MatchRemoteModules(std::istream& fin, const std::string& stampDir); void ConsiderModule(const std::string& name, const std::string& stampDir); |