diff options
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 8090e00..a2d0efe 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1378,9 +1378,9 @@ void cmLocalGenerator::OutputLinkLibraries( std::string linkLanguage = cli.GetLinkLanguage(); - std::string libPathFlag = + const std::string& libPathFlag = this->Makefile->GetRequiredDefinition("CMAKE_LIBRARY_PATH_FLAG"); - std::string libPathTerminator = + const std::string& libPathTerminator = this->Makefile->GetSafeDefinition("CMAKE_LIBRARY_PATH_TERMINATOR"); // Add standard libraries for this language. @@ -2237,11 +2237,8 @@ void cmLocalGenerator::JoinDefines(const std::set<std::string>& defines, dflag = df; } } - - std::set<std::string>::const_iterator defineIt = defines.begin(); - const std::set<std::string>::const_iterator defineEnd = defines.end(); const char* itemSeparator = definesString.empty() ? "" : " "; - for (; defineIt != defineEnd; ++defineIt) { + for (std::string const& define : defines) { // Append the definition with proper escaping. std::string def = dflag; if (this->GetState()->UseWatcomWMake()) { @@ -2255,7 +2252,7 @@ void cmLocalGenerator::JoinDefines(const std::set<std::string>& defines, // command line without any escapes. However we still have to // get the '$' and '#' characters through WMake as '$$' and // '$#'. - for (const char* c = defineIt->c_str(); *c; ++c) { + for (const char* c = define.c_str(); *c; ++c) { if (*c == '$' || *c == '#') { def += '$'; } @@ -2264,11 +2261,11 @@ void cmLocalGenerator::JoinDefines(const std::set<std::string>& defines, } else { // Make the definition appear properly on the command line. Use // -DNAME="value" instead of -D"NAME=value" for historical reasons. - std::string::size_type eq = defineIt->find("="); - def += defineIt->substr(0, eq); + std::string::size_type eq = define.find('='); + def += define.substr(0, eq); if (eq != std::string::npos) { def += "="; - def += this->EscapeForShell(defineIt->c_str() + eq + 1, true); + def += this->EscapeForShell(define.c_str() + eq + 1, true); } } definesString += itemSeparator; |