Commit 68dad94b authored by Brad King's avatar Brad King

ENH: Implement Fortran module dependencies across targets and directories.

  - See issue #5809
  - Keep information about all sources in the target until deps are written
  - Create a fortran.internal file after scanning that lists modules provided
  - Load fortran.internal files from linked targets to find modules
  - Search the include path for external modules
  - Create file-level deps on in-project module timestamps or external mods
parent 42f3f3c3
......@@ -75,6 +75,13 @@ bool cmDepends::Write(std::ostream &makeDepends,
}
}
return this->Finalize(makeDepends, internalDepends);
}
//----------------------------------------------------------------------------
bool cmDepends::Finalize(std::ostream&,
std::ostream&)
{
return true;
}
......
......@@ -85,6 +85,10 @@ protected:
// otherwise.
virtual bool CheckDependencies(std::istream& internalDepends);
// Finalize the dependency information for the target.
virtual bool Finalize(std::ostream& makeDepends,
std::ostream& internalDepends);
// The directory in which the build rule for the target file is executed.
std::string CompileDirectory;
......
This diff is collapsed.
......@@ -19,6 +19,9 @@
#include "cmDepends.h"
class cmDependsFortranInternals;
class cmDependsFortranSourceInfo;
/** \class cmDependsFortran
* \brief Dependency scanner for Fortran object files.
*/
......@@ -50,17 +53,37 @@ public:
std::string& fileName);
protected:
// Finalize the dependency information for the target.
virtual bool Finalize(std::ostream& makeDepends,
std::ostream& internalDepends);
// Find all the modules required by the target.
void LocateModules();
void MatchLocalModules();
void MatchRemoteModules(std::istream& fin, const char* moduleDir);
void ConsiderModule(const char* name, const char* moduleDir);
bool FindModule(std::string const& name, std::string& module);
// Implement writing/checking methods required by superclass.
virtual bool WriteDependencies(
const char *src, const char *file,
std::ostream& makeDepends, std::ostream& internalDepends);
// Actually write the depenencies to the streams.
bool WriteDependenciesReal(const char *obj,
cmDependsFortranSourceInfo const& info,
std::ostream& makeDepends,
std::ostream& internalDepends);
// The source file from which to start scanning.
std::string SourceFile;
// The include file search path.
std::vector<std::string> const* IncludePath;
// Internal implementation details.
cmDependsFortranInternals* Internal;
private:
cmDependsFortran(cmDependsFortran const&); // Purposely not implemented.
void operator=(cmDependsFortran const&); // Purposely not implemented.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment