diff options
author | Matthew Hoops | 2012-08-26 15:49:45 -0400 |
---|---|---|
committer | Matthew Hoops | 2012-08-26 16:12:25 -0400 |
commit | bb1e60e8b2f3bba06ae3b089097f94ea82a70c8a (patch) | |
tree | a434233367725fbb6dc7072776c312f52254d57f /devtools/create_project/xcode.cpp | |
parent | 7a49b3669a0e18210a2f5409cb35da735f549b11 (diff) | |
parent | 857b92f8ffececa9c1f990d21a6a8d1630199a62 (diff) | |
download | scummvm-rg350-bb1e60e8b2f3bba06ae3b089097f94ea82a70c8a.tar.gz scummvm-rg350-bb1e60e8b2f3bba06ae3b089097f94ea82a70c8a.tar.bz2 scummvm-rg350-bb1e60e8b2f3bba06ae3b089097f94ea82a70c8a.zip |
Merge remote branch 'upstream/master' into pegasus
Conflicts:
AUTHORS
devtools/credits.pl
gui/credits.h
Diffstat (limited to 'devtools/create_project/xcode.cpp')
-rw-r--r-- | devtools/create_project/xcode.cpp | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 39470f4e19..62dd417d8c 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -202,18 +202,38 @@ void XCodeProvider::writeFileListToProject(const FileNode &dir, std::ofstream &p // Init root group _groups.comment = "PBXGroup"; - Object *group = new Object(this, "PBXGroup", "PBXGroup", "PBXGroup", "", ""); - //Property children; - //children.flags = SettingsAsList; - //group->properties["children"] = children; - group->addProperty("children", "", "", SettingsNoValue|SettingsAsList); + // Create group + std::string name = getLastPathComponent(dir.name); + Object *group = new Object(this, "PBXGroup_" + name , "PBXGroup", "PBXGroup", "", name); + + // List of children + Property children; + children.hasOrder = true; + children.flags = SettingsAsList; + group->addProperty("name", name, "", SettingsNoValue|SettingsQuoteVariable); group->addProperty("sourceTree", "<group>", "", SettingsNoValue|SettingsQuoteVariable); - _groups.add(group); + int order = 0; + for (FileNode::NodeList::const_iterator i = dir.children.begin(); i != dir.children.end(); ++i) { + const FileNode *node = *i; + + std::string id = "FileReference_" + node->name; + FileProperty property = FileProperty(node->name, node->name, node->name, "<group>"); + + ADD_SETTING_ORDER_NOVALUE(children, getHash(id), node->name, order++); + ADD_BUILD_FILE(id, node->name, node->name + " in Sources"); + ADD_FILE_REFERENCE(node->name, property); + + // Process child nodes + if (!node->children.empty()) + writeFileListToProject(*node, projectFile, indentation + 1, duplicate, objPrefix + node->name + '_', filePrefix + node->name + '/'); + } - // TODO Add files + group->properties["children"] = children; + + _groups.add(group); } ////////////////////////////////////////////////////////////////////////// @@ -717,6 +737,7 @@ void XCodeProvider::setupBuildConfiguration() { ADD_SETTING_QUOTE(scummvmSimulator_Debug, "FRAMEWORK_SEARCH_PATHS", "$(inherited)"); ADD_SETTING_LIST(scummvmSimulator_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, SettingsNoQuote|SettingsAsList, 5); ADD_SETTING(scummvmSimulator_Debug, "SDKROOT", "iphonesimulator3.2"); + ADD_SETTING_QUOTE(scummvmSimulator_Debug, "VALID_ARCHS", "i386 x86_64"); REMOVE_SETTING(scummvmSimulator_Debug, "TARGETED_DEVICE_FAMILY"); scummvmSimulator_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue); @@ -726,6 +747,7 @@ void XCodeProvider::setupBuildConfiguration() { Object *scummvmSimulator_Release_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-Simulator_Release", _targets[2] /* ScummVM-Simulator */, "XCBuildConfiguration", "PBXNativeTarget", "Release"); Property scummvmSimulator_Release(scummvmSimulator_Debug); ADD_SETTING(scummvmSimulator_Release, "COPY_PHASE_STRIP", "YES"); + ADD_SETTING(scummvmSimulator_Release, "GCC_OPTIMIZATION_LEVEL", "3"); REMOVE_SETTING(scummvmSimulator_Release, "GCC_DYNAMIC_NO_PIC"); ADD_SETTING(scummvmSimulator_Release, "WRAPPER_EXTENSION", "app"); @@ -871,7 +893,9 @@ std::string XCodeProvider::writeProperty(const std::string &variable, Property & std::string XCodeProvider::writeSetting(const std::string &variable, std::string value, std::string comment, int flags, int indent) const { return writeSetting(variable, Setting(value, comment, flags, indent)); } -// Heavily modified (not in a good way) function, imported from QMake XCode project generator (licensed under the QT license) + +// Heavily modified (not in a good way) function, imported from the QMake +// XCode project generator pbuilder_pbx.cpp, writeSettings() (under LGPL 2.1) std::string XCodeProvider::writeSetting(const std::string &variable, const Setting &setting) const { std::string output; const std::string quote = (setting.flags & SettingsNoQuote) ? "" : "\""; @@ -893,7 +917,7 @@ std::string XCodeProvider::writeSetting(const std::string &variable, const Setti for (unsigned int i = 0, count = 0; i < setting.entries.size(); ++i) { std::string value = setting.entries.at(i).value; - if(!value.empty()) { + if (!value.empty()) { if (count++ > 0) output += "," + newline; |