diff options
author | Brad King <brad.king@kitware.com> | 2015-04-20 18:02:48 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-04-20 18:02:48 (GMT) |
commit | da65528c36fd071117d4e1aa13fa1a71c09312d8 (patch) | |
tree | fbdc872db7be10d69e04483cfb80d40bb3426b80 /Source/cmGlobalXCodeGenerator.cxx | |
parent | 73ff279d07712d6293126e7488960db054ce51be (diff) | |
parent | 6693590f8144a905b423ca03fa8ed98df4468bae (diff) | |
download | CMake-da65528c36fd071117d4e1aa13fa1a71c09312d8.zip CMake-da65528c36fd071117d4e1aa13fa1a71c09312d8.tar.gz CMake-da65528c36fd071117d4e1aa13fa1a71c09312d8.tar.bz2 |
Merge topic 'stable-xcode-projects'
6693590f Xcode: Refine quoting rules for Strings
a6331eb8 Xcode: Let PrintComment decide if the comment is non-empty
6e8952c1 Xcode: PrintComment will prepend a whitespace itself before the comment
4bd2544b Xcode: Do not add whitespace after attribute group opening brace
5cb4c838 Xcode: Properly indent PBXFileReference and PBXBuildFile
a723427b Xcode: Remove extra space in PBXProject comment
2fe8bca5 Xcode: Add comment after root object
2e0e205e Xcode: Indent using tabs
7b68c8df Xcode: Sort Xcode objects by Id
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 7488386..8c37338 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -592,6 +592,20 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile( } //---------------------------------------------------------------------------- + +static bool objectIdLessThan(cmXCodeObject* l, cmXCodeObject* r) +{ + return l->GetId() < r->GetId(); +} + +//---------------------------------------------------------------------------- +void cmGlobalXCodeGenerator::SortXCodeObjects() +{ + std::sort(this->XCodeObjects.begin(), this->XCodeObjects.end(), + objectIdLessThan); +} + +//---------------------------------------------------------------------------- void cmGlobalXCodeGenerator::ClearXCodeObjects() { this->TargetDoneSet.clear(); @@ -3372,7 +3386,7 @@ bool cmGlobalXCodeGenerator } configlist->AddAttribute("buildConfigurations", buildConfigurations); - std::string comment = "Build configuration list for PBXProject "; + std::string comment = "Build configuration list for PBXProject"; comment += " \""; comment += this->CurrentProject; comment += "\""; @@ -3713,6 +3727,8 @@ cmGlobalXCodeGenerator::WriteXCodePBXProj(std::ostream& fout, cmLocalGenerator* , std::vector<cmLocalGenerator*>& ) { + SortXCodeObjects(); + fout << "// !$*UTF8*$!\n"; fout << "{\n"; cmXCodeObject::Indent(1, fout); @@ -3740,7 +3756,8 @@ cmGlobalXCodeGenerator::WriteXCodePBXProj(std::ostream& fout, cmXCodeObject::PrintList(this->XCodeObjects, fout); } cmXCodeObject::Indent(1, fout); - fout << "rootObject = " << this->RootObject->GetId() << ";\n"; + fout << "rootObject = " << this->RootObject->GetId() + << " /* Project object */;\n"; fout << "}\n"; } |