summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-03-21 13:08:01 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-03-21 13:08:10 (GMT)
commit87223a24f061c519caf72df63e61be9676e322ea (patch)
tree98a2c886947cbc904730254a90f2f7afdb7f7ce4 /Source
parent64bb65777ad011d96c6bedca36b24df7d9a1371d (diff)
parent8c0f12c4aa4d3b6a83ea663f27d1affed61abcf6 (diff)
downloadCMake-87223a24f061c519caf72df63e61be9676e322ea.zip
CMake-87223a24f061c519caf72df63e61be9676e322ea.tar.gz
CMake-87223a24f061c519caf72df63e61be9676e322ea.tar.bz2
Merge topic 'makefile-fix-depend-optimization'
8c0f12c4aa Makefile: Restore use of dependency scanning cache Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1870
Diffstat (limited to 'Source')
-rw-r--r--Source/cmDependsC.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx
index 62bc8d9..34c0e94 100644
--- a/Source/cmDependsC.cxx
+++ b/Source/cmDependsC.cxx
@@ -96,9 +96,16 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
std::set<std::string> dependencies;
bool haveDeps = false;
+ std::string binDir = this->LocalGenerator->GetBinaryDirectory();
+
+ // Compute a path to the object file to write to the internal depend file.
+ // Any existing content of the internal depend file has already been
+ // loaded in ValidDeps with this path as a key.
+ std::string obj_i = this->LocalGenerator->ConvertToRelativePath(binDir, obj);
+
if (this->ValidDeps != nullptr) {
std::map<std::string, DependencyVector>::const_iterator tmpIt =
- this->ValidDeps->find(obj);
+ this->ValidDeps->find(obj_i);
if (tmpIt != this->ValidDeps->end()) {
dependencies.insert(tmpIt->second.begin(), tmpIt->second.end());
haveDeps = true;
@@ -222,8 +229,6 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
// written by the original local generator for this directory
// convert the dependencies to paths relative to the home output
// directory. We must do the same here.
- std::string binDir = this->LocalGenerator->GetBinaryDirectory();
- std::string obj_i = this->LocalGenerator->ConvertToRelativePath(binDir, obj);
std::string obj_m = cmSystemTools::ConvertToOutputPath(obj_i);
internalDepends << obj_i << std::endl;