diff options
Diffstat (limited to 'Source/cmComputeTargetDepends.cxx')
-rw-r--r-- | Source/cmComputeTargetDepends.cxx | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index 58ec53a..a98a608 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -151,6 +151,7 @@ void cmComputeTargetDepends::GetTargetDirectDepends(cmGeneratorTarget const* t, cmGeneratorTarget const* dep = this->Targets[ni]; auto di = deps.insert(dep).first; di->SetType(ni.IsStrong()); + di->SetCross(ni.IsCross()); di->SetBacktrace(ni.GetBacktrace()); } } @@ -217,7 +218,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index) return; } const_cast<cmGeneratorTarget*>(depender)->Target->AddUtility( - objLib); + objLib, false); } } } @@ -225,11 +226,12 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index) cmLinkImplementation const* impl = depender->GetLinkImplementation(it); // A target should not depend on itself. - emitted.insert(cmLinkItem(depender, cmListFileBacktrace())); + emitted.insert(cmLinkItem(depender, false, cmListFileBacktrace())); + emitted.insert(cmLinkItem(depender, true, cmListFileBacktrace())); for (cmLinkImplItem const& lib : impl->Libraries) { // Don't emit the same library twice for this target. if (emitted.insert(lib).second) { - this->AddTargetDepend(depender_index, lib, true); + this->AddTargetDepend(depender_index, lib, true, false); this->AddInterfaceDepends(depender_index, lib, it, emitted); } } @@ -241,11 +243,12 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index) std::set<cmLinkItem> const& tutils = depender->GetUtilityItems(); std::set<cmLinkItem> emitted; // A target should not depend on itself. - emitted.insert(cmLinkItem(depender, cmListFileBacktrace())); + emitted.insert(cmLinkItem(depender, false, cmListFileBacktrace())); + emitted.insert(cmLinkItem(depender, true, cmListFileBacktrace())); for (cmLinkItem const& litem : tutils) { // Don't emit the same utility twice for this target. if (emitted.insert(litem).second) { - this->AddTargetDepend(depender_index, litem, false); + this->AddTargetDepend(depender_index, litem, false, litem.Cross); } } } @@ -267,7 +270,7 @@ void cmComputeTargetDepends::AddInterfaceDepends( // code in the project that caused this dependency to be added. cmLinkItem libBT = lib; libBT.Backtrace = dependee_backtrace; - this->AddTargetDepend(depender_index, libBT, true); + this->AddTargetDepend(depender_index, libBT, true, false); this->AddInterfaceDepends(depender_index, libBT, config, emitted); } } @@ -290,7 +293,8 @@ void cmComputeTargetDepends::AddInterfaceDepends( if (dependee) { // A target should not depend on itself. - emitted.insert(cmLinkItem(depender, cmListFileBacktrace())); + emitted.insert(cmLinkItem(depender, false, cmListFileBacktrace())); + emitted.insert(cmLinkItem(depender, true, cmListFileBacktrace())); this->AddInterfaceDepends(depender_index, dependee, dependee_name.Backtrace, config, emitted); } @@ -298,7 +302,7 @@ void cmComputeTargetDepends::AddInterfaceDepends( void cmComputeTargetDepends::AddTargetDepend(int depender_index, cmLinkItem const& dependee_name, - bool linking) + bool linking, bool cross) { // Get the depender. cmGeneratorTarget const* depender = this->Targets[depender_index]; @@ -343,13 +347,13 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index, if (dependee) { this->AddTargetDepend(depender_index, dependee, dependee_name.Backtrace, - linking); + linking, cross); } } void cmComputeTargetDepends::AddTargetDepend( int depender_index, cmGeneratorTarget const* dependee, - cmListFileBacktrace const& dependee_backtrace, bool linking) + cmListFileBacktrace const& dependee_backtrace, bool linking, bool cross) { if (dependee->IsImported() || dependee->GetType() == cmStateEnums::INTERFACE_LIBRARY) { @@ -359,7 +363,7 @@ void cmComputeTargetDepends::AddTargetDepend( for (cmLinkItem const& i : utils) { if (cmGeneratorTarget const* transitive_dependee = i.Target) { this->AddTargetDepend(depender_index, transitive_dependee, i.Backtrace, - false); + false, i.Cross); } } } else { @@ -371,7 +375,7 @@ void cmComputeTargetDepends::AddTargetDepend( // Add this entry to the dependency graph. this->InitialGraph[depender_index].emplace_back(dependee_index, !linking, - dependee_backtrace); + cross, dependee_backtrace); } } @@ -505,7 +509,8 @@ bool cmComputeTargetDepends::IntraComponent(std::vector<int> const& cmap, for (cmGraphEdge const& edge : el) { int j = edge; if (cmap[j] == c && edge.IsStrong()) { - this->FinalGraph[i].emplace_back(j, true, edge.GetBacktrace()); + this->FinalGraph[i].emplace_back(j, true, edge.IsCross(), + edge.GetBacktrace()); if (!this->IntraComponent(cmap, c, j, head, emitted, visited)) { return false; } @@ -514,7 +519,8 @@ bool cmComputeTargetDepends::IntraComponent(std::vector<int> const& cmap, // Prepend to a linear linked-list of intra-component edges. if (*head >= 0) { - this->FinalGraph[i].emplace_back(*head, false, cmListFileBacktrace()); + this->FinalGraph[i].emplace_back(*head, false, false, + cmListFileBacktrace()); } else { this->ComponentTail[c] = i; } @@ -564,7 +570,8 @@ bool cmComputeTargetDepends::ComputeFinalDepends( int dependee_component = ni; int dependee_component_head = this->ComponentHead[dependee_component]; this->FinalGraph[depender_component_tail].emplace_back( - dependee_component_head, ni.IsStrong(), ni.GetBacktrace()); + dependee_component_head, ni.IsStrong(), ni.IsCross(), + ni.GetBacktrace()); } } return true; |