Merge topic 'xcode-ARCHS-quoting'

a8ded53 Xcode: Quote string values containing '$' (#11244)
0790af3 Xcode: Avoid trailing space in ARCHS list (#11244)
This commit is contained in:
Brad King 2010-09-21 10:42:50 -04:00 committed by CMake Topic Stage
commit 5968785b2f
2 changed files with 4 additions and 2 deletions

View File

@ -2726,12 +2726,14 @@ void cmGlobalXCodeGenerator
buildSettings->AddAttribute("SDKROOT", buildSettings->AddAttribute("SDKROOT",
this->CreateString(sysroot)); this->CreateString(sysroot));
std::string archString; std::string archString;
const char* sep = "";
for( std::vector<std::string>::iterator i = for( std::vector<std::string>::iterator i =
this->Architectures.begin(); this->Architectures.begin();
i != this->Architectures.end(); ++i) i != this->Architectures.end(); ++i)
{ {
archString += sep;
archString += *i; archString += *i;
archString += " "; sep = " ";
} }
buildSettings->AddAttribute("ARCHS", buildSettings->AddAttribute("ARCHS",
this->CreateString(archString.c_str())); this->CreateString(archString.c_str()));

View File

@ -236,7 +236,7 @@ void cmXCodeObject::PrintString(std::ostream& os) const
// considered special by the Xcode project file parser. // considered special by the Xcode project file parser.
bool needQuote = bool needQuote =
(this->String.empty() || (this->String.empty() ||
this->String.find_first_of(" <>.+-=@") != this->String.npos); this->String.find_first_of(" <>.+-=@$") != this->String.npos);
const char* quote = needQuote? "\"" : ""; const char* quote = needQuote? "\"" : "";
// Print the string, quoted and escaped as necessary. // Print the string, quoted and escaped as necessary.