diff options
author | Brad King <brad.king@kitware.com> | 2021-05-12 19:51:47 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-05-13 16:47:25 (GMT) |
commit | 15fa3200715869d5acb94a282feb301d2e10a0eb (patch) | |
tree | 9c5d6c18b03b2917cc54d7fa2cfa5b9c89d8e4b0 /Source/cmDependsC.cxx | |
parent | 1879f1bcbc4e2fbd9eaca4eff351ab928c4a3268 (diff) | |
download | CMake-15fa3200715869d5acb94a282feb301d2e10a0eb.zip CMake-15fa3200715869d5acb94a282feb301d2e10a0eb.tar.gz CMake-15fa3200715869d5acb94a282feb301d2e10a0eb.tar.bz2 |
cmLocalGenerator: Factor out relative path conversion helpers
Most calls to `MaybeConvertToRelativePath` use one of our common work
directories (e.g. top of the build tree) as the local path. Add helpers
for each of the common cases to simplify and clarify call sites.
Diffstat (limited to 'Source/cmDependsC.cxx')
-rw-r--r-- | Source/cmDependsC.cxx | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index 60e8cbf..da37d45 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -90,13 +90,10 @@ 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->MaybeConvertToRelativePath(binDir, obj); + std::string obj_i = this->LocalGenerator->MaybeRelativeToTopBinDir(obj); if (this->ValidDeps != nullptr) { auto const tmpIt = this->ValidDeps->find(obj_i); @@ -228,7 +225,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources, } for (std::string const& dep : dependencies) { std::string dependee = this->LocalGenerator->ConvertToMakefilePath( - this->LocalGenerator->MaybeConvertToRelativePath(binDir, dep)); + this->LocalGenerator->MaybeRelativeToTopBinDir(dep)); if (supportLongLineDepend) { makeDepends << ' ' << lineContinue << ' ' << dependee; } else { |