diff options
Diffstat (limited to 'Source/cmComputeLinkDepends.cxx')
-rw-r--r-- | Source/cmComputeLinkDepends.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index e9bf5a5cd0..5341e8d8c1 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -5,7 +5,6 @@ #include <algorithm> #include <cassert> #include <cstdio> -#include <cstring> #include <iterator> #include <sstream> #include <utility> @@ -18,6 +17,7 @@ #include "cmListFileCache.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" +#include "cmProperty.h" #include "cmRange.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" @@ -253,13 +253,13 @@ cmComputeLinkDepends::Compute() // Compute the final set of link entries. // Iterate in reverse order so we can keep only the last occurrence // of a shared library. - std::set<int> emmitted; + std::set<int> emitted; for (int i : cmReverseRange(this->FinalLinkOrder)) { LinkEntry const& e = this->EntryList[i]; cmGeneratorTarget const* t = e.Target; // Entries that we know the linker will re-use do not need to be repeated. bool uniquify = t && t->GetType() == cmStateEnums::SHARED_LIBRARY; - if (!uniquify || emmitted.insert(i).second) { + if (!uniquify || emitted.insert(i).second) { this->FinalLinkEntries.push_back(e); } } @@ -315,9 +315,9 @@ int cmComputeLinkDepends::AddLinkEntry(cmLinkItem const& item) } else { // Look for an old-style <item>_LIB_DEPENDS variable. std::string var = cmStrCat(entry.Item.Value, "_LIB_DEPENDS"); - if (const char* val = this->Makefile->GetDefinition(var)) { + if (cmProp val = this->Makefile->GetDefinition(var)) { // The item dependencies are known. Follow them. - BFSEntry qe = { index, val }; + BFSEntry qe = { index, val->c_str() }; this->BFSQueue.push(qe); } else if (!entry.IsFlag) { // The item dependencies are not known. We need to infer them. @@ -454,10 +454,10 @@ void cmComputeLinkDepends::AddVarLinkEntries(int depender_index, // lower. if (!haveLLT) { std::string var = cmStrCat(d, "_LINK_TYPE"); - if (const char* val = this->Makefile->GetDefinition(var)) { - if (strcmp(val, "debug") == 0) { + if (cmProp val = this->Makefile->GetDefinition(var)) { + if (*val == "debug") { llt = DEBUG_LibraryType; - } else if (strcmp(val, "optimized") == 0) { + } else if (*val == "optimized") { llt = OPTIMIZED_LibraryType; } } @@ -626,6 +626,7 @@ void cmComputeLinkDepends::OrderLinkEntires() // constraints disallow it. this->CCG = cm::make_unique<cmComputeComponentGraph>(this->EntryConstraintGraph); + this->CCG->Compute(); // The component graph is guaranteed to be acyclic. Start a DFS // from every entry to compute a topological order for the |