aboutsummaryrefslogtreecommitdiff
path: root/devtools
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2015-04-09 19:24:27 +0200
committerEinar Johan Trøan Sømåen2015-04-09 20:02:18 +0200
commit1f13d42c6b4981e26df5342e2804f3bcdf70ad73 (patch)
tree353330ccc7a5f102b2fe5cc6dcb28d0cd7f3675e /devtools
parent790f7dc0178b05a519b9e353e8e6d542ae6d9cf9 (diff)
downloadscummvm-rg350-1f13d42c6b4981e26df5342e2804f3bcdf70ad73.tar.gz
scummvm-rg350-1f13d42c6b4981e26df5342e2804f3bcdf70ad73.tar.bz2
scummvm-rg350-1f13d42c6b4981e26df5342e2804f3bcdf70ad73.zip
CREATE_PROJECT: Refactor the Framework and library adding for XCode, and add the relevant Frameworks to a group.
Diffstat (limited to 'devtools')
-rw-r--r--devtools/create_project/xcode.cpp47
1 files changed, 27 insertions, 20 deletions
diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp
index ab94bdc05f..4628cf9de9 100644
--- a/devtools/create_project/xcode.cpp
+++ b/devtools/create_project/xcode.cpp
@@ -62,15 +62,15 @@ namespace CreateProjectTool {
#define REMOVE_SETTING(config, key) \
config.settings.erase(key);
-#define ADD_BUILD_FILE(id, name, comment) { \
+#define ADD_BUILD_FILE(id, name, fileRefId, comment) { \
Object *buildFile = new Object(this, id, name, "PBXBuildFile", "PBXBuildFile", comment); \
- buildFile->addProperty("fileRef", getHash(name), name, SettingsNoValue); \
+ buildFile->addProperty("fileRef", fileRefId, name, SettingsNoValue); \
_buildFile.add(buildFile); \
_buildFile.flags = SettingsSingleItem; \
}
-#define ADD_FILE_REFERENCE(name, properties) { \
- Object *fileRef = new Object(this, name, name, "PBXFileReference", "PBXFileReference", name); \
+#define ADD_FILE_REFERENCE(id, name, properties) { \
+ Object *fileRef = new Object(this, id, name, "PBXFileReference", "PBXFileReference", name); \
if (!properties.fileEncoding.empty()) fileRef->addProperty("fileEncoding", properties.fileEncoding, "", SettingsNoValue); \
if (!properties.lastKnownFileType.empty()) fileRef->addProperty("lastKnownFileType", properties.lastKnownFileType, "", SettingsNoValue|SettingsQuoteVariable); \
if (!properties.fileName.empty()) fileRef->addProperty("name", properties.fileName, "", SettingsNoValue|SettingsQuoteVariable); \
@@ -324,6 +324,9 @@ void XCodeProvider::setupCopyFilesBuildPhase() {
#define DEF_SYSFRAMEWORK(framework) properties[framework".framework"] = FileProperty("wrapper.framework", framework".framework", "System/Library/Frameworks/" framework ".framework", "SDKROOT"); \
ADD_SETTING_ORDER_NOVALUE(children, getHash(framework".framework"), framework".framework", fwOrder++);
+#define DEF_LOCALLIB_STATIC(lib) properties[lib".a"] = FileProperty("archive.ar", lib".a", "/opt/local/lib/" lib ".a", "\"<group>\""); \
+ ADD_SETTING_ORDER_NOVALUE(children, getHash(lib".a"), lib".a", fwOrder++);
+
/**
* Sets up the frameworks build phase.
*
@@ -333,9 +336,7 @@ void XCodeProvider::setupFrameworksBuildPhase() {
_frameworksBuildPhase.comment = "PBXFrameworksBuildPhase";
// Just use a hardcoded id for the Frameworks-group
- Object *frameworksGroup = new Object(this, "PBXGroup_CustomTemplate_Frameworks_" , "PBXGroup", "PBXGroup", "", "CustomTemplate_Frameworks_");
- frameworksGroup->addProperty("name", "Frameworks", "", SettingsNoValue|SettingsQuoteVariable);
- frameworksGroup->addProperty("sourceTree", "<group>", "", SettingsNoValue|SettingsQuoteVariable);
+ Group *frameworksGroup = new Group(this, "Frameworks", "PBXGroup_CustomTemplate_Frameworks_", "");
Property children;
children.hasOrder = true;
@@ -359,17 +360,21 @@ void XCodeProvider::setupFrameworksBuildPhase() {
DEF_SYSFRAMEWORK("QuartzCore");
DEF_SYSFRAMEWORK("QuickTime");
DEF_SYSFRAMEWORK("UIKit");
+ // Optionals:
+ DEF_SYSFRAMEWORK("OpenGL");
+
+ // Local libraries
+ DEF_LOCALLIB_STATIC("libFLAC");
+ DEF_LOCALLIB_STATIC("libmad");
+ DEF_LOCALLIB_STATIC("libvorbisidec");
+ DEF_LOCALLIB_STATIC("libfreetype");
+// DEF_LOCALLIB_STATIC("libmpeg2");
frameworksGroup->properties["children"] = children;
_groups.add(frameworksGroup);
// Force this to be added as a sub-group in the root.
- _rootGroups.add(frameworksGroup);
+ _rootSourceGroup->addChildGroup(frameworksGroup);
- // Local libraries
- properties["libFLAC.a"] = FileProperty("archive.ar", "libFLAC.a", "lib/libFLAC.a", "\"<group>\"");
- properties["libmad.a"] = FileProperty("archive.ar", "libmad.a", "lib/libmad.a", "\"<group>\"");
- //properties["libmpeg2.a"] = FileProperty("archive.ar", "libmpeg2.a", "lib/libmpeg2.a", "\"<group>\"");
- properties["libvorbisidec.a"] = FileProperty("archive.ar", "libvorbisidec.a", "lib/libvorbisidec.a", "\"<group>\"");
// Declare this here, as it's used across the three targets
int order = 0;
@@ -404,8 +409,8 @@ void XCodeProvider::setupFrameworksBuildPhase() {
std::string comment = *framework + " in Frameworks";
ADD_SETTING_ORDER_NOVALUE(iPhone_files, getHash(id), comment, order++);
- ADD_BUILD_FILE(id, *framework, comment);
- ADD_FILE_REFERENCE(*framework, properties[*framework]);
+ ADD_BUILD_FILE(id, *framework, getHash(*framework), comment);
+ ADD_FILE_REFERENCE(*framework, *framework, properties[*framework]);
}
framework_iPhone->properties["files"] = iPhone_files;
@@ -437,6 +442,8 @@ void XCodeProvider::setupFrameworksBuildPhase() {
frameworks_osx.push_back("IOKit.framework");
frameworks_osx.push_back("Cocoa.framework");
frameworks_osx.push_back("AudioUnit.framework");
+ // Optionals:
+ frameworks_osx.push_back("OpenGL.framework");
order = 0;
for (ValueList::iterator framework = frameworks_osx.begin(); framework != frameworks_osx.end(); framework++) {
@@ -444,8 +451,8 @@ void XCodeProvider::setupFrameworksBuildPhase() {
std::string comment = *framework + " in Frameworks";
ADD_SETTING_ORDER_NOVALUE(osx_files, getHash(id), comment, order++);
- ADD_BUILD_FILE(id, *framework, comment);
- ADD_FILE_REFERENCE(*framework, properties[*framework]);
+ ADD_BUILD_FILE(id, *framework, getHash(*framework), comment);
+ ADD_FILE_REFERENCE(*framework, *framework, properties[*framework]);
}
framework_OSX->properties["files"] = osx_files;
@@ -479,8 +486,8 @@ void XCodeProvider::setupFrameworksBuildPhase() {
std::string comment = *framework + " in Frameworks";
ADD_SETTING_ORDER_NOVALUE(simulator_files, getHash(id), comment, order++);
- ADD_BUILD_FILE(id, *framework, comment);
- ADD_FILE_REFERENCE(*framework, properties[*framework]);
+ ADD_BUILD_FILE(id, *framework, getHash(*framework), comment);
+ ADD_FILE_REFERENCE(*framework, *framework, properties[*framework]);
}
framework_simulator->properties["files"] = simulator_files;
@@ -623,7 +630,7 @@ void XCodeProvider::setupResourcesBuildPhase() {
ADD_SETTING_ORDER_NOVALUE(files, getHash(id), comment, order++);
// TODO Fix crash when adding build file for data
//ADD_BUILD_FILE(id, *file, comment);
- ADD_FILE_REFERENCE(*file, properties[*file]);
+ ADD_FILE_REFERENCE(*file, *file, properties[*file]);
}
// Add custom files depending on the target