From dc0ddb9e34f885d32f0fa3bb25072ec77e4a79bb Mon Sep 17 00:00:00 2001 From: Gregor Jasny Date: Sun, 3 Jan 2016 11:58:52 +0100 Subject: Xcode: Store configuration name along with XcodeObject (#14947) --- Source/cmGlobalXCodeGenerator.cxx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 6f192cb..3ac1137 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -3440,18 +3440,19 @@ bool cmGlobalXCodeGenerator this->CreateObject(cmXCodeObject::XCConfigurationList); cmXCodeObject* buildConfigurations = this->CreateObject(cmXCodeObject::OBJECT_LIST); - std::vector configs; + typedef std::vector > Configs; + Configs configs; const char *defaultConfigName = "Debug"; if(this->XcodeVersion == 15) { cmXCodeObject* configDebug = this->CreateObject(cmXCodeObject::XCBuildConfiguration); configDebug->AddAttribute("name", this->CreateString("Debug")); - configs.push_back(configDebug); + configs.push_back(std::make_pair("Debug", configDebug)); cmXCodeObject* configRelease = this->CreateObject(cmXCodeObject::XCBuildConfiguration); configRelease->AddAttribute("name", this->CreateString("Release")); - configs.push_back(configRelease); + configs.push_back(std::make_pair("Release", configRelease)); } else { @@ -3465,13 +3466,12 @@ bool cmGlobalXCodeGenerator cmXCodeObject* config = this->CreateObject(cmXCodeObject::XCBuildConfiguration); config->AddAttribute("name", this->CreateString(name)); - configs.push_back(config); + configs.push_back(std::make_pair(name, config)); } } - for(std::vector::iterator c = configs.begin(); - c != configs.end(); ++c) + for(Configs::iterator c = configs.begin(); c != configs.end(); ++c) { - buildConfigurations->AddObject(*c); + buildConfigurations->AddObject(c->second); } configlist->AddAttribute("buildConfigurations", buildConfigurations); @@ -3547,10 +3547,9 @@ bool cmGlobalXCodeGenerator } } - for( std::vector::iterator i = configs.begin(); - i != configs.end(); ++i) + for(Configs::iterator i = configs.begin(); i != configs.end(); ++i) { - (*i)->AddAttribute("buildSettings", buildSettings); + i->second->AddAttribute("buildSettings", buildSettings); } this->RootObject->AddAttribute("buildConfigurationList", -- cgit v0.12