Xcode: Avoid trailing space in ARCHS list (#11244)

With CMAKE_OSX_ARCHITECTURE settings such as $(ARCHS_STANDARD_32BIT),
the space inserted by the for loop would confuse Xcode if quoted. In
this particular example, what would be output would be:

  ARCHS = "$(ARCHS_STANDARD_32BIT) ";

The Xcode UI does not recognize this as the built-in "Standards 32-bit"
architecture setting unless the space is removed.
This commit is contained in:
Mikkel Krautz 2010-09-20 10:02:39 -04:00 committed by Brad King
parent 4c06e23307
commit 0790af3bf5
1 changed files with 3 additions and 1 deletions

View File

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