diff options
author | Yurii Batrak <yuriib@met.no> | 2017-11-24 12:01:18 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-12-14 13:13:42 (GMT) |
commit | 5f2e2c387deb7f798cbc54d0980503e05873eaaa (patch) | |
tree | 95a65992d8754c8d1b96bf0ad2073753244fa8b1 /Source/cmMakefileTargetGenerator.cxx | |
parent | eea976e930fcb7e8f92968c241d50ed49a1f1f0b (diff) | |
download | CMake-5f2e2c387deb7f798cbc54d0980503e05873eaaa.zip CMake-5f2e2c387deb7f798cbc54d0980503e05873eaaa.tar.gz CMake-5f2e2c387deb7f798cbc54d0980503e05873eaaa.tar.bz2 |
Makefiles: Avoid nested make calls for Fortran module dependencies
Makefiles generated by cmake use a series of nested calls to build
`*.provides.build` targets that are used when the 'requires' step is
needed. That leads to significant degradation of the build time for
incremental builds. Re-arrange dependencies to eliminate the nested
calls.
Explicit `.mod.stamp` targets introduced by this commit could lead to
situation when a stamp file always older than its dependency. This
happens during the incremental build when building of an updated Fortran
source produces a module file that has no differences from the stored
stamp file. In such case `cmake_copy_f90_mod` will be triggered on each
new build to compare a module file with the corresponding stamp file.
This behavior is expected and can not be changed without nested calls
that slow down the build. The copy-if-different check is much cheaper
than an entire nested make call.
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 7db010c..ae0b61c 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -835,14 +835,10 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( std::string temp = relativeObj; temp += ".provides.build"; std::vector<std::string> r_commands; - std::string tgtMakefileName = - this->LocalGenerator->GetRelativeTargetDirectory(this->GeneratorTarget); - tgtMakefileName += "/build.make"; - r_commands.push_back( - this->LocalGenerator->GetRecursiveMakeCall(tgtMakefileName.c_str(), temp)); p_depends.clear(); p_depends.push_back(objectRequires); + p_depends.push_back(temp); this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr, objectProvides, p_depends, r_commands, true); |