diff options
Diffstat (limited to 'Source/cmComputeLinkInformation.cxx')
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 6986965..62eaec2 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -239,7 +239,7 @@ because this need be done only for shared libraries without soname-s. //---------------------------------------------------------------------------- cmComputeLinkInformation -::cmComputeLinkInformation(cmTarget const* target, const char* config, +::cmComputeLinkInformation(cmTarget const* target, const std::string& config, cmTarget const* headTarget) { // Store context information. @@ -268,7 +268,7 @@ cmComputeLinkInformation // Get the language used for linking this target. this->LinkLanguage = this->Target->GetLinkerLanguage(config, headTarget); - if(!this->LinkLanguage) + if(this->LinkLanguage.empty()) { // The Compute method will do nothing, so skip the rest of the // initialization. @@ -496,16 +496,17 @@ bool cmComputeLinkInformation::Compute() } // We require a link language for the target. - if(!this->LinkLanguage) + if(this->LinkLanguage.empty()) { cmSystemTools:: Error("CMake can not determine linker language for target: ", - this->Target->GetName()); + this->Target->GetName().c_str()); return false; } // Compute the ordered link line items. - cmComputeLinkDepends cld(this->Target, this->Config, this->HeadTarget); + cmComputeLinkDepends cld(this->Target, this->Config.c_str(), + this->HeadTarget); cld.SetOldLinkDirMode(this->OldLinkDirMode); cmComputeLinkDepends::EntryVector const& linkEntries = cld.Compute(); @@ -624,7 +625,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item, cmTarget const* tgt) { // Compute the proper name to use to link this library. - const char* config = this->Config; + const std::string& config = this->Config; bool impexe = (tgt && tgt->IsExecutableWithExports()); if(impexe && !this->UseImportLibrary && !this->LoaderFlag) { @@ -902,7 +903,7 @@ void cmComputeLinkInformation::ComputeItemParserInfo() // be the library name. Match index 3 will be the library // extension. reg = "^("; - for(std::set<cmStdString>::iterator p = this->LinkPrefixes.begin(); + for(std::set<std::string>::iterator p = this->LinkPrefixes.begin(); p != this->LinkPrefixes.end(); ++p) { reg += *p; @@ -1126,9 +1127,10 @@ void cmComputeLinkInformation::AddFullItem(std::string const& item) // Full path libraries should specify a valid library file name. // See documentation of CMP0008. + std::string generator = this->GlobalGenerator->GetName(); if(this->Target->GetPolicyStatusCMP0008() != cmPolicies::NEW && - (strstr(this->GlobalGenerator->GetName(), "Visual Studio") || - strstr(this->GlobalGenerator->GetName(), "Xcode"))) + (generator.find("Visual Studio") != generator.npos || + generator.find("Xcode") != generator.npos)) { std::string file = cmSystemTools::GetFilenameName(item); if(!this->ExtractAnyLibraryName.find(file.c_str())) @@ -1640,7 +1642,7 @@ void cmComputeLinkInformation::PrintLinkPolicyDiagnosis(std::ostream& os) // List the paths old behavior is adding. os << "and other libraries with known full path:\n"; - std::set<cmStdString> emitted; + std::set<std::string> emitted; for(std::vector<std::string>::const_iterator i = this->OldLinkDirItems.begin(); i != this->OldLinkDirItems.end(); ++i) @@ -1856,7 +1858,7 @@ cmComputeLinkInformation::AddLibraryRuntimeInfo(std::string const& fullPath) //---------------------------------------------------------------------------- static void cmCLI_ExpandListUnique(const char* str, std::vector<std::string>& out, - std::set<cmStdString>& emitted) + std::set<std::string>& emitted) { std::vector<std::string> tmp; cmSystemTools::ExpandListArgument(str, tmp); @@ -1894,7 +1896,7 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs, this->Target->GetPropertyAsBool("INSTALL_RPATH_USE_LINK_PATH"); // Construct the RPATH. - std::set<cmStdString> emitted; + std::set<std::string> emitted; if(use_install_rpath) { const char* install_rpath = this->Target->GetProperty("INSTALL_RPATH"); |