diff options
Diffstat (limited to 'Source/cmDependsFortran.cxx')
-rw-r--r-- | Source/cmDependsFortran.cxx | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index a239418..1a06f31 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -12,6 +12,7 @@ #include "cmFortranParser.h" /* Interface to parser object. */ #include "cmGeneratedFileStream.h" +#include "cmGlobalUnixMakefileGenerator3.h" #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmOutputConverter.h" @@ -320,14 +321,28 @@ bool cmDependsFortran::WriteDependenciesReal(std::string const& obj, std::string obj_i = this->MaybeConvertToRelativePath(binDir, obj); std::string obj_m = cmSystemTools::ConvertToOutputPath(obj_i); internalDepends << obj_i << "\n " << src << '\n'; - for (std::string const& i : info.Includes) { - makeDepends << obj_m << ": " - << cmSystemTools::ConvertToOutputPath( - this->MaybeConvertToRelativePath(binDir, i)) - << '\n'; - internalDepends << ' ' << i << '\n'; + if (!info.Includes.empty()) { + const auto& lineContinue = static_cast<cmGlobalUnixMakefileGenerator3*>( + this->LocalGenerator->GetGlobalGenerator()) + ->LineContinueDirective; + bool supportLongLineDepend = static_cast<cmGlobalUnixMakefileGenerator3*>( + this->LocalGenerator->GetGlobalGenerator()) + ->SupportsLongLineDependencies(); + if (supportLongLineDepend) { + makeDepends << obj_m << ':'; + } + for (std::string const& i : info.Includes) { + std::string dependee = cmSystemTools::ConvertToOutputPath( + this->MaybeConvertToRelativePath(binDir, i)); + if (supportLongLineDepend) { + makeDepends << ' ' << lineContinue << ' ' << dependee; + } else { + makeDepends << obj_m << ": " << dependee << '\n'; + } + internalDepends << ' ' << i << '\n'; + } + makeDepends << '\n'; } - makeDepends << '\n'; // Write module requirements to the output stream. for (std::string const& i : info.Requires) { |