summaryrefslogtreecommitdiff
path: root/Source/cmDependsCompiler.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmDependsCompiler.cxx')
-rw-r--r--Source/cmDependsCompiler.cxx14
1 files changed, 6 insertions, 8 deletions
diff --git a/Source/cmDependsCompiler.cxx b/Source/cmDependsCompiler.cxx
index 09f55997bf..bf599ffaf0 100644
--- a/Source/cmDependsCompiler.cxx
+++ b/Source/cmDependsCompiler.cxx
@@ -192,21 +192,19 @@ void cmDependsCompiler::WriteDependencies(
bool supportLongLineDepend = static_cast<cmGlobalUnixMakefileGenerator3*>(
this->LocalGenerator->GetGlobalGenerator())
->SupportsLongLineDependencies();
- const auto& binDir = this->LocalGenerator->GetBinaryDirectory();
cmDepends::DependencyMap makeDependencies(dependencies);
std::unordered_set<cm::string_view> phonyTargets;
// external dependencies file
for (auto& node : makeDependencies) {
auto target = this->LocalGenerator->ConvertToMakefilePath(
- this->LocalGenerator->MaybeConvertToRelativePath(binDir, node.first));
+ this->LocalGenerator->MaybeRelativeToTopBinDir(node.first));
auto& deps = node.second;
- std::transform(
- deps.cbegin(), deps.cend(), deps.begin(),
- [this, &binDir](const std::string& dep) {
- return this->LocalGenerator->ConvertToMakefilePath(
- this->LocalGenerator->MaybeConvertToRelativePath(binDir, dep));
- });
+ std::transform(deps.cbegin(), deps.cend(), deps.begin(),
+ [this](const std::string& dep) {
+ return this->LocalGenerator->ConvertToMakefilePath(
+ this->LocalGenerator->MaybeRelativeToTopBinDir(dep));
+ });
bool first_dep = true;
if (supportLongLineDepend) {