summaryrefslogtreecommitdiffstats
path: root/Source/cmDependsFortran.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-02-02 16:46:23 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-02-02 16:46:44 (GMT)
commit371417f4b02c4d3b22e987329853176223c34613 (patch)
tree9336dd05679226d68c851a27cd28aaaf94774504 /Source/cmDependsFortran.cxx
parentc01d01646ab774862040c7147bb4f48cb31f1750 (diff)
parent13810dee17794c5d57845e5a7a0b38b4204dd734 (diff)
downloadCMake-371417f4b02c4d3b22e987329853176223c34613.zip
CMake-371417f4b02c4d3b22e987329853176223c34613.tar.gz
CMake-371417f4b02c4d3b22e987329853176223c34613.tar.bz2
Merge topic 'modules-lang-specific-target-linked-dirs' into release-3.26
13810dee17 cmDependsFortran: require that dependency info files work eed295fd8a cmGlobalNinjaGenerator: require that dependency info files work 837f7c113a cmCommonTargetGenerator: classify linked target directories by language d19648a928 cmGeneratorTarget: add a method to query if Fortran sources exist 245a89d8b6 cmMakefileTargetGenerator: make "target linked info" variable Fortran-specific aeb1b2ae3d cmMakefileTargetGenerator: simplify string streaming Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !8146
Diffstat (limited to 'Source/cmDependsFortran.cxx')
-rw-r--r--Source/cmDependsFortran.cxx18
1 files changed, 12 insertions, 6 deletions
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx
index ac93c90..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.
@@ -243,15 +245,19 @@ void cmDependsFortran::LocateModules()
// Load information about other targets.
cmMakefile* mf = this->LocalGenerator->GetMakefile();
std::vector<std::string> infoFiles;
- mf->GetDefExpandList("CMAKE_TARGET_LINKED_INFO_FILES", infoFiles);
+ mf->GetDefExpandList("CMAKE_Fortran_TARGET_LINKED_INFO_FILES", infoFiles);
for (std::string const& i : infoFiles) {
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()