aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLittleboy2012-07-14 16:33:41 -0400
committerLittleboy2012-07-14 16:33:41 -0400
commit67751f77c8abae0f6326cb0daec67cd6dd272c7d (patch)
treefa2e9e5b60f6509aa833f93ee8abee04f0b1967d
parent4cee0836c9d4dda646f1e76a3440ffb73499dbb5 (diff)
downloadscummvm-rg350-67751f77c8abae0f6326cb0daec67cd6dd272c7d.tar.gz
scummvm-rg350-67751f77c8abae0f6326cb0daec67cd6dd272c7d.tar.bz2
scummvm-rg350-67751f77c8abae0f6326cb0daec67cd6dd272c7d.zip
CREATE_PROJECT: Output Groups and File references in XCode provider
-rw-r--r--devtools/create_project/create_project.cpp26
-rw-r--r--devtools/create_project/create_project.h8
-rw-r--r--devtools/create_project/xcode.cpp36
3 files changed, 46 insertions, 24 deletions
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index c96b83414a..8499fec400 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -76,14 +76,6 @@ namespace {
std::string unifyPath(const std::string &path);
/**
- * Returns the last path component.
- *
- * @param path Path string.
- * @return Last path component.
- */
-std::string getLastPathComponent(const std::string &path);
-
-/**
* Display the help text for the program.
*
* @param exe Name of the executable.
@@ -606,14 +598,6 @@ std::string unifyPath(const std::string &path) {
return result;
}
-std::string getLastPathComponent(const std::string &path) {
- std::string::size_type pos = path.find_last_of('/');
- if (pos == std::string::npos)
- return path;
- else
- return path.substr(pos + 1);
-}
-
void displayHelp(const char *exe) {
using std::cout;
@@ -1001,7 +985,7 @@ bool isInList(const std::string &dir, const std::string &fileName, const StringL
continue;
}
- const std::string lastPathComponent = getLastPathComponent(*i);
+ const std::string lastPathComponent = ProjectProvider::getLastPathComponent(*i);
if (extensionName == "o") {
return false;
} else if (!producesObjectFile(fileName) && extensionName != "h") {
@@ -1304,6 +1288,14 @@ std::string ProjectProvider::createUUID() const {
#endif
}
+std::string ProjectProvider::getLastPathComponent(const std::string &path) {
+ std::string::size_type pos = path.find_last_of('/');
+ if (pos == std::string::npos)
+ return path;
+ else
+ return path.substr(pos + 1);
+}
+
void ProjectProvider::addFilesToProject(const std::string &dir, std::ofstream &projectFile,
const StringList &includeList, const StringList &excludeList,
const std::string &filePrefix) {
diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h
index 8719143f4a..b4eda8f8d2 100644
--- a/devtools/create_project/create_project.h
+++ b/devtools/create_project/create_project.h
@@ -317,6 +317,14 @@ public:
*/
void createProject(const BuildSetup &setup);
+ /**
+ * Returns the last path component.
+ *
+ * @param path Path string.
+ * @return Last path component.
+ */
+ static std::string getLastPathComponent(const std::string &path);
+
protected:
const int _version; ///< Target project version
StringList &_globalWarnings; ///< Global warnings
diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp
index 9784bb0bf5..0574814e02 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");