From 283eac7e5fe5a01dea1b0c3bf6efc0bd70b84e84 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Tue, 1 Dec 2015 21:00:32 +0100 Subject: IOS: Create a separate for adding resources --- devtools/create_project/codeblocks.cpp | 5 +++++ devtools/create_project/codeblocks.h | 2 ++ devtools/create_project/create_project.cpp | 3 +-- devtools/create_project/create_project.h | 7 +++++++ devtools/create_project/msvc.cpp | 5 +++++ devtools/create_project/msvc.h | 2 ++ devtools/create_project/xcode.cpp | 3 +++ devtools/create_project/xcode.h | 2 ++ 8 files changed, 27 insertions(+), 2 deletions(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/codeblocks.cpp b/devtools/create_project/codeblocks.cpp index 442a2b0025..e9dc8bf234 100644 --- a/devtools/create_project/codeblocks.cpp +++ b/devtools/create_project/codeblocks.cpp @@ -200,6 +200,11 @@ void CodeBlocksProvider::createProjectFile(const std::string &name, const std::s } +void CodeBlocksProvider::addResourceFiles(const BuildSetup &setup, StringList &includeList, StringList &excludeList) { + includeList.push_back(setup.srcDir + "/icons/" + setup.projectName + ".ico"); + includeList.push_back(setup.srcDir + "/dists/" + setup.projectName + ".rc"); +} + void CodeBlocksProvider::writeWarnings(const std::string &name, std::ofstream &output) const { // Global warnings diff --git a/devtools/create_project/codeblocks.h b/devtools/create_project/codeblocks.h index f65604d925..5baa21c242 100644 --- a/devtools/create_project/codeblocks.h +++ b/devtools/create_project/codeblocks.h @@ -37,6 +37,8 @@ protected: void createOtherBuildFiles(const BuildSetup &) {} + void addResourceFiles(const BuildSetup &setup, StringList &includeList, StringList &excludeList); + void createProjectFile(const std::string &name, const std::string &uuid, const BuildSetup &setup, const std::string &moduleDir, const StringList &includeList, const StringList &excludeList); diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp index 0aba511491..914651d6b8 100644 --- a/devtools/create_project/create_project.cpp +++ b/devtools/create_project/create_project.cpp @@ -1334,8 +1334,7 @@ void ProjectProvider::createProject(BuildSetup &setup) { createModuleList(setup.srcDir + "/image", setup.defines, setup.testDirs, in, ex); // Resource files - in.push_back(setup.srcDir + "/icons/" + setup.projectName + ".ico"); - in.push_back(setup.srcDir + "/dists/" + setup.projectName + ".rc"); + addResourceFiles(setup, in, ex); // Various text files in.push_back(setup.srcDir + "/AUTHORS"); diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h index 459342a67d..b81576d4ed 100644 --- a/devtools/create_project/create_project.h +++ b/devtools/create_project/create_project.h @@ -418,6 +418,13 @@ protected: */ virtual void createOtherBuildFiles(const BuildSetup &setup) = 0; + /** + * Add resources to the project + * + * @param setup Description of the desired build setup. + */ + virtual void addResourceFiles(const BuildSetup &setup, StringList &includeList, StringList &excludeList) = 0; + /** * Create a project file for the specified list of files. * diff --git a/devtools/create_project/msvc.cpp b/devtools/create_project/msvc.cpp index dbfbcc128d..e6b47fe724 100644 --- a/devtools/create_project/msvc.cpp +++ b/devtools/create_project/msvc.cpp @@ -130,6 +130,11 @@ void MSVCProvider::createOtherBuildFiles(const BuildSetup &setup) { createBuildProp(setup, false, true, "LLVM"); } +void MSVCProvider::addResourceFiles(const BuildSetup &setup, StringList &includeList, StringList &excludeList) { + includeList.push_back(setup.srcDir + "/icons/" + setup.projectName + ".ico"); + includeList.push_back(setup.srcDir + "/dists/" + setup.projectName + ".rc"); +} + void MSVCProvider::createGlobalProp(const BuildSetup &setup) { std::ofstream properties((setup.outputDir + '/' + setup.projectDescription + "_Global" + getPropertiesExtension()).c_str()); if (!properties) diff --git a/devtools/create_project/msvc.h b/devtools/create_project/msvc.h index e75e131bd1..178ba8e216 100644 --- a/devtools/create_project/msvc.h +++ b/devtools/create_project/msvc.h @@ -39,6 +39,8 @@ protected: void createOtherBuildFiles(const BuildSetup &setup); + void addResourceFiles(const BuildSetup &setup, StringList &includeList, StringList &excludeList); + /** * Create the global project properties. * diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index babd530ad7..7f2dc89218 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -212,6 +212,9 @@ XcodeProvider::XcodeProvider(StringList &global_warnings, std::mapproperties["files"] = iPhone_files; _frameworksBuildPhase.add(framework_iPhone); -#endif ////////////////////////////////////////////////////////////////////////// // ScummVM-OS X Object *framework_OSX = new Object(this, "PBXFrameworksBuildPhase_" + _targets[OSX_TARGET], "PBXFrameworksBuildPhase", "PBXFrameworksBuildPhase", "", "Frameworks"); @@ -471,7 +461,6 @@ void XcodeProvider::setupFrameworksBuildPhase() { framework_OSX->properties["files"] = osx_files; _frameworksBuildPhase.add(framework_OSX); -#ifdef ENABLE_IOS ////////////////////////////////////////////////////////////////////////// // Simulator Object *framework_simulator = new Object(this, "PBXFrameworksBuildPhase_" + _targets[SIM_TARGET], "PBXFrameworksBuildPhase", "PBXFrameworksBuildPhase", "", "Frameworks"); @@ -506,7 +495,6 @@ void XcodeProvider::setupFrameworksBuildPhase() { framework_simulator->properties["files"] = simulator_files; _frameworksBuildPhase.add(framework_simulator); -#endif } void XcodeProvider::setupNativeTarget() { @@ -516,11 +504,6 @@ void XcodeProvider::setupNativeTarget() { Group *productsGroup = new Group(this, "Products", "PBXGroup_CustomTemplate_Products_" , ""); // Output native target section for (unsigned int i = 0; i < _targets.size(); i++) { -#ifndef ENABLE_IOS - if (i != OSX_TARGET) { // TODO: Fix iOS-targets, for now just disable them. - continue; - } -#endif Object *target = new Object(this, "PBXNativeTarget_" + _targets[i], "PBXNativeTarget", "PBXNativeTarget", "", _targets[i]); target->addProperty("buildConfigurationList", getHash("XCConfigurationList_" + _targets[i]), "Build configuration list for PBXNativeTarget \"" + _targets[i] + "\"", SettingsNoValue); @@ -576,18 +559,13 @@ void XcodeProvider::setupProject() { // List of targets Property targets; targets.flags = SettingsAsList; -#ifdef ENABLE_IOS targets.settings[getHash("PBXNativeTarget_" + _targets[IOS_TARGET])] = Setting("", _targets[IOS_TARGET], SettingsNoValue, 0, 0); -#endif targets.settings[getHash("PBXNativeTarget_" + _targets[OSX_TARGET])] = Setting("", _targets[OSX_TARGET], SettingsNoValue, 0, 1); -#ifdef ENABLE_IOS targets.settings[getHash("PBXNativeTarget_" + _targets[SIM_TARGET])] = Setting("", _targets[SIM_TARGET], SettingsNoValue, 0, 2); -#endif project->properties["targets"] = targets; -#ifndef ENABLE_IOS + // Force list even when there is only a single target project->properties["targets"].flags |= SettingsSingleItem; -#endif _project.add(project); } @@ -711,7 +689,6 @@ void XcodeProvider::setupBuildConfiguration() { ///**************************************** // * iPhone // ****************************************/ -#ifdef ENABLE_IOS // Debug Object *iPhone_Debug_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-iPhone_Debug", _targets[IOS_TARGET] /* ScummVM-iPhone */, "XCBuildConfiguration", "PBXNativeTarget", "Debug"); Property iPhone_Debug; @@ -767,7 +744,6 @@ void XcodeProvider::setupBuildConfiguration() { _buildConfiguration.add(iPhone_Debug_Object); _buildConfiguration.add(iPhone_Release_Object); -#endif /**************************************** * scummvm ****************************************/ @@ -898,7 +874,6 @@ void XcodeProvider::setupBuildConfiguration() { _buildConfiguration.add(scummvmOSX_Debug_Object); _buildConfiguration.add(scummvmOSX_Release_Object); -#ifdef ENABLE_IOS /**************************************** * ScummVM-Simulator ****************************************/ @@ -933,7 +908,6 @@ void XcodeProvider::setupBuildConfiguration() { // Configuration List _configurationList.comment = "XCConfigurationList"; _configurationList.flags = SettingsAsList; -#endif // Warning: This assumes we have all configurations with a Debug & Release pair for (std::vector::iterator config = _buildConfiguration.objects.begin(); config != _buildConfiguration.objects.end(); config++) { -- cgit v1.2.3 From 0dde5e4a183fdb551ba003487819052ce250cbc5 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Tue, 1 Dec 2015 21:16:17 +0100 Subject: IOS: Remove the simulator specific target The simulator works with the same target than the iPhone / iPad target. --- devtools/create_project/xcode.cpp | 76 ++------------------------------------- 1 file changed, 3 insertions(+), 73 deletions(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 745d86e108..76698ac556 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -32,7 +32,6 @@ namespace CreateProjectTool { #define IOS_TARGET 0 #define OSX_TARGET 1 -#define SIM_TARGET 2 #define ADD_DEFINE(defines, name) \ defines.push_back(name); @@ -220,9 +219,8 @@ void XcodeProvider::createWorkspace(const BuildSetup &setup) { // Setup global objects setupDefines(setup); - _targets.push_back(PROJECT_DESCRIPTION "-iPhone"); + _targets.push_back(PROJECT_DESCRIPTION "-iOS"); _targets.push_back(PROJECT_DESCRIPTION "-OS X"); - _targets.push_back(PROJECT_DESCRIPTION "-Simulator"); setupCopyFilesBuildPhase(); setupFrameworksBuildPhase(); setupNativeTarget(); @@ -381,10 +379,10 @@ void XcodeProvider::setupFrameworksBuildPhase() { _rootSourceGroup->addChildGroup(frameworksGroup); - // Declare this here, as it's used across the three targets + // Declare this here, as it's used across all the targets int order = 0; ////////////////////////////////////////////////////////////////////////// - // iPhone + // ScummVM-iOS Object *framework_iPhone = new Object(this, "PBXFrameworksBuildPhase_" + _targets[IOS_TARGET], "PBXFrameworksBuildPhase", "PBXFrameworksBuildPhase", "", "Frameworks"); framework_iPhone->addProperty("buildActionMask", "2147483647", "", SettingsNoValue); @@ -461,40 +459,6 @@ void XcodeProvider::setupFrameworksBuildPhase() { framework_OSX->properties["files"] = osx_files; _frameworksBuildPhase.add(framework_OSX); - ////////////////////////////////////////////////////////////////////////// - // Simulator - Object *framework_simulator = new Object(this, "PBXFrameworksBuildPhase_" + _targets[SIM_TARGET], "PBXFrameworksBuildPhase", "PBXFrameworksBuildPhase", "", "Frameworks"); - - framework_simulator->addProperty("buildActionMask", "2147483647", "", SettingsNoValue); - framework_simulator->addProperty("runOnlyForDeploymentPostprocessing", "0", "", SettingsNoValue); - - // List of frameworks - Property simulator_files; - simulator_files.hasOrder = true; - simulator_files.flags = SettingsAsList; - - ValueList frameworks_simulator; - frameworks_simulator.push_back("CoreAudio.framework"); - frameworks_simulator.push_back("CoreFoundation.framework"); - frameworks_simulator.push_back("Foundation.framework"); - frameworks_simulator.push_back("UIKit.framework"); - frameworks_simulator.push_back("AudioToolbox.framework"); - frameworks_simulator.push_back("QuartzCore.framework"); - frameworks_simulator.push_back("OpenGLES.framework"); - - order = 0; - for (ValueList::iterator framework = frameworks_simulator.begin(); framework != frameworks_simulator.end(); framework++) { - std::string id = "Frameworks_" + *framework + "_simulator"; - std::string comment = *framework + " in Frameworks"; - - ADD_SETTING_ORDER_NOVALUE(simulator_files, getHash(id), comment, order++); - ADD_BUILD_FILE(id, *framework, getHash(*framework), comment); - ADD_FILE_REFERENCE(*framework, *framework, properties[*framework]); - } - - framework_simulator->properties["files"] = simulator_files; - - _frameworksBuildPhase.add(framework_simulator); } void XcodeProvider::setupNativeTarget() { @@ -561,7 +525,6 @@ void XcodeProvider::setupProject() { targets.flags = SettingsAsList; targets.settings[getHash("PBXNativeTarget_" + _targets[IOS_TARGET])] = Setting("", _targets[IOS_TARGET], SettingsNoValue, 0, 0); targets.settings[getHash("PBXNativeTarget_" + _targets[OSX_TARGET])] = Setting("", _targets[OSX_TARGET], SettingsNoValue, 0, 1); - targets.settings[getHash("PBXNativeTarget_" + _targets[SIM_TARGET])] = Setting("", _targets[SIM_TARGET], SettingsNoValue, 0, 2); project->properties["targets"] = targets; // Force list even when there is only a single target @@ -874,40 +837,7 @@ void XcodeProvider::setupBuildConfiguration() { _buildConfiguration.add(scummvmOSX_Debug_Object); _buildConfiguration.add(scummvmOSX_Release_Object); - /**************************************** - * ScummVM-Simulator - ****************************************/ - - // Debug - Object *scummvmSimulator_Debug_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-Simulator_Debug", _targets[SIM_TARGET] /* ScummVM-Simulator */, "XCBuildConfiguration", "PBXNativeTarget", "Debug"); - Property scummvmSimulator_Debug(iPhone_Debug); - 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); - scummvmSimulator_Debug_Object->properties["buildSettings"] = scummvmSimulator_Debug; - // Release - Object *scummvmSimulator_Release_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-Simulator_Release", _targets[SIM_TARGET] /* 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"); - - scummvmSimulator_Release_Object->addProperty("name", "Release", "", SettingsNoValue); - scummvmSimulator_Release_Object->properties["buildSettings"] = scummvmSimulator_Release; - - _buildConfiguration.add(scummvmSimulator_Debug_Object); - _buildConfiguration.add(scummvmSimulator_Release_Object); - - ////////////////////////////////////////////////////////////////////////// - // Configuration List - _configurationList.comment = "XCConfigurationList"; - _configurationList.flags = SettingsAsList; // Warning: This assumes we have all configurations with a Debug & Release pair for (std::vector::iterator config = _buildConfiguration.objects.begin(); config != _buildConfiguration.objects.end(); config++) { -- cgit v1.2.3 From 4c68d145c2e9b6333d929a2bad828f14b3a1422b Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Tue, 1 Dec 2015 21:18:53 +0100 Subject: IOS: Keep the MACOSX, and IPHONE macros according to the target --- devtools/create_project/xcode.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 76698ac556..084be76739 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -36,6 +36,9 @@ namespace CreateProjectTool { #define ADD_DEFINE(defines, name) \ defines.push_back(name); +#define REMOVE_DEFINE(defines, name) \ + { auto i = std::find(defines.begin(), defines.end(), name); if (i != defines.end()) defines.erase(i); } + #define ADD_SETTING(config, key, value) \ config.settings[key] = Setting(value, "", SettingsNoQuote); @@ -690,6 +693,11 @@ void XcodeProvider::setupBuildConfiguration() { ADD_SETTING_QUOTE_VAR(iPhone_Debug, "PROVISIONING_PROFILE[sdk=iphoneos*]", ""); ADD_SETTING(iPhone_Debug, "SDKROOT", "iphoneos4.0"); ADD_SETTING_QUOTE(iPhone_Debug, "TARGETED_DEVICE_FAMILY", "1,2"); + ValueList scummvmIOS_defines(_defines); + REMOVE_DEFINE(scummvmIOS_defines, "MACOSX"); + ADD_DEFINE(scummvmIOS_defines, "IPHONE"); + ADD_DEFINE(scummvmIOS_defines, "IPHONE_OFFICIAL"); + ADD_SETTING_LIST(iPhone_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmIOS_defines, SettingsNoQuote|SettingsAsList, 5); iPhone_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue); iPhone_Debug_Object->properties["buildSettings"] = iPhone_Debug; @@ -726,9 +734,9 @@ void XcodeProvider::setupBuildConfiguration() { ADD_SETTING(scummvm_Debug, "GCC_INPUT_FILETYPE", "automatic"); ADD_SETTING(scummvm_Debug, "GCC_OPTIMIZATION_LEVEL", "0"); ValueList scummvm_defines(_defines); - ADD_DEFINE(scummvm_defines, "IPHONE"); + REMOVE_DEFINE(scummvm_defines, "MACOSX"); + REMOVE_DEFINE(scummvm_defines, "IPHONE"); ADD_DEFINE(scummvm_defines, "XCODE"); - ADD_DEFINE(scummvm_defines, "IPHONE_OFFICIAL"); ADD_SETTING_LIST(scummvm_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, SettingsNoQuote|SettingsAsList, 5); ADD_SETTING(scummvm_Debug, "GCC_THUMB_SUPPORT", "NO"); ADD_SETTING(scummvm_Debug, "GCC_USE_GCC3_PFE_SUPPORT", "NO"); @@ -784,6 +792,7 @@ void XcodeProvider::setupBuildConfiguration() { ADD_SETTING(scummvmOSX_Debug, "GCC_PRECOMPILE_PREFIX_HEADER", "NO"); ADD_SETTING_QUOTE(scummvmOSX_Debug, "GCC_PREFIX_HEADER", ""); ValueList scummvmOSX_defines(_defines); + REMOVE_DEFINE(scummvmOSX_defines, "IPHONE"); ADD_DEFINE(scummvmOSX_defines, "SDL_BACKEND"); ADD_DEFINE(scummvmOSX_defines, "MACOSX"); ADD_SETTING_LIST(scummvmOSX_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmOSX_defines, SettingsNoQuote|SettingsAsList, 5); -- cgit v1.2.3 From b58ec8f15ac1710af7353626bc488495bfb9e868 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Tue, 1 Dec 2015 21:25:36 +0100 Subject: IOS: Fixes various iOS compilation flags, and missing frameworks --- devtools/create_project/xcode.cpp | 162 ++++++++++++++++++++++++++++++-------- devtools/create_project/xcode.h | 4 +- 2 files changed, 130 insertions(+), 36 deletions(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 084be76739..13b6ddad7c 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -90,6 +90,53 @@ bool producesObjectFileOnOSX(const std::string &fileName) { return false; } +bool targetIsIOS(const std::string &targetName) { + return targetName.length() > 4 && targetName.substr(targetName.length() - 4) == "-iOS"; +} + +bool shouldSkipFileForTarget(const std::string &fileID, const std::string &targetName, const std::string &fileName) { + // There are 3 rules used to determine if a specific file belongs to a target: + // 1) if the parent directory is "backends/platform/iphone", the file belongs to the iOS target. + // 2) if the parent directory is "/sdl", the file belongs to the OS X target. + // 3) if the file has a suffix, like "_osx", or "_ios", the file belongs to one of the target. + std::string name, ext; + splitFilename(fileName, name, ext); + if (targetIsIOS(targetName)) { + // iOS target: we skip all files with the "_osx" suffix + if (name.length() > 4 && name.substr(name.length() - 4) == "_osx") { + return true; + } + // We don't need SDL for the iOS target + static const std::string sdl_directory = "/sdl/"; + static const std::string surfacesdl_directory = "/surfacesdl/"; + static const std::string doublebufferdl_directory = "/doublebuffersdl/"; + if (fileID.find(sdl_directory) != std::string::npos + || fileID.find(surfacesdl_directory) != std::string::npos + || fileID.find(doublebufferdl_directory) != std::string::npos) { + return true; + } + } + else { + // Ugly hack: explicitely remove the browser.cpp file. + // The problem is that we have only one project for two different targets, + // and the parsing of the "mk" files added this file for both targets... + if (fileID.length() > 12 && fileID.substr(fileID.length() - 12) == "/browser.cpp") { + return true; + } + // OS X target: we skip all files with the "_ios" suffix + if (name.length() > 4 && name.substr(name.length() - 4) == "_ios") { + return true; + } + // parent directory + const std::string directory = fileID.substr(0, fileID.length() - fileName.length()); + static const std::string iphone_directory = "backends/platform/iphone"; + if (directory.length() > iphone_directory.length() && directory.substr(directory.length() - iphone_directory.length()) == iphone_directory) { + return true; + } + } + return false; +} + XcodeProvider::Group::Group(XcodeProvider *objectParent, const std::string &groupName, const std::string &uniqueName, const std::string &path) : Object(objectParent, uniqueName, groupName, "PBXGroup", "", groupName) { addProperty("name", name, "", SettingsNoValue|SettingsQuoteVariable); addProperty("sourceTree", "", "", SettingsNoValue|SettingsQuoteVariable); @@ -211,6 +258,11 @@ XcodeProvider::XcodeProvider(StringList &global_warnings, std::map\""); \ + +#define DEF_LOCALLIB_STATIC_PATH(path,lib) properties[lib".a"] = FileProperty("archive.ar", lib ".a", path, "\"\""); \ ADD_SETTING_ORDER_NOVALUE(children, getHash(lib".a"), lib".a", fwOrder++); +#define DEF_LOCALLIB_STATIC(lib) DEF_LOCALLIB_STATIC_PATH("/opt/local/lib/" lib ".a", lib) + + /** * Sets up the frameworks build phase. * * (each native target has different build rules) */ -void XcodeProvider::setupFrameworksBuildPhase() { +void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) { _frameworksBuildPhase.comment = "PBXFrameworksBuildPhase"; // Just use a hardcoded id for the Frameworks-group @@ -358,6 +413,7 @@ void XcodeProvider::setupFrameworksBuildPhase() { DEF_SYSFRAMEWORK("Carbon"); DEF_SYSFRAMEWORK("Cocoa"); DEF_SYSFRAMEWORK("CoreAudio"); + DEF_SYSFRAMEWORK("CoreGraphics"); DEF_SYSFRAMEWORK("CoreFoundation"); DEF_SYSFRAMEWORK("CoreMIDI"); DEF_SYSFRAMEWORK("Foundation"); @@ -376,6 +432,19 @@ void XcodeProvider::setupFrameworksBuildPhase() { DEF_LOCALLIB_STATIC("libfreetype"); // DEF_LOCALLIB_STATIC("libmpeg2"); + std::string absoluteOutputDir; +#ifdef POSIX + absoluteOutputDir = realpath((setup.outputDir + "/lib").c_str(), NULL); +#else + absoluteOutputDir = "lib"; +#endif + + DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libFLACiOS.a", "libFLACiOS"); + DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libFreetype2.a", "libFreetype2"); + DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libogg.a", "libogg"); + DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libpng.a", "libpng"); + DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libvorbis.a", "libvorbis"); + frameworksGroup->properties["children"] = children; _groups.add(frameworksGroup); // Force this to be added as a sub-group in the root. @@ -384,6 +453,7 @@ void XcodeProvider::setupFrameworksBuildPhase() { // Declare this here, as it's used across all the targets int order = 0; + ////////////////////////////////////////////////////////////////////////// // ScummVM-iOS Object *framework_iPhone = new Object(this, "PBXFrameworksBuildPhase_" + _targets[IOS_TARGET], "PBXFrameworksBuildPhase", "PBXFrameworksBuildPhase", "", "Frameworks"); @@ -392,35 +462,39 @@ void XcodeProvider::setupFrameworksBuildPhase() { framework_iPhone->addProperty("runOnlyForDeploymentPostprocessing", "0", "", SettingsNoValue); // List of frameworks - Property iPhone_files; - iPhone_files.hasOrder = true; - iPhone_files.flags = SettingsAsList; - - ValueList frameworks_iPhone; - frameworks_iPhone.push_back("CoreAudio.framework"); - frameworks_iPhone.push_back("CoreFoundation.framework"); - frameworks_iPhone.push_back("Foundation.framework"); - frameworks_iPhone.push_back("UIKit.framework"); - frameworks_iPhone.push_back("AudioToolbox.framework"); - frameworks_iPhone.push_back("QuartzCore.framework"); - frameworks_iPhone.push_back("libmad.a"); - //frameworks_iPhone.push_back("libmpeg2.a"); - frameworks_iPhone.push_back("libFLAC.a"); - frameworks_iPhone.push_back("libvorbisidec.a"); - frameworks_iPhone.push_back("OpenGLES.framework"); - - for (ValueList::iterator framework = frameworks_iPhone.begin(); framework != frameworks_iPhone.end(); framework++) { + Property iOS_files; + iOS_files.hasOrder = true; + iOS_files.flags = SettingsAsList; + + ValueList frameworks_iOS; + frameworks_iOS.push_back("CoreAudio.framework"); + frameworks_iOS.push_back("CoreGraphics.framework"); + frameworks_iOS.push_back("CoreFoundation.framework"); + frameworks_iOS.push_back("Foundation.framework"); + frameworks_iOS.push_back("UIKit.framework"); + frameworks_iOS.push_back("AudioToolbox.framework"); + frameworks_iOS.push_back("QuartzCore.framework"); + frameworks_iOS.push_back("OpenGLES.framework"); + + frameworks_iOS.push_back("libFLACiOS.a"); + frameworks_iOS.push_back("libFreetype2.a"); + frameworks_iOS.push_back("libogg.a"); + frameworks_iOS.push_back("libpng.a"); + frameworks_iOS.push_back("libvorbis.a"); + + for (ValueList::iterator framework = frameworks_iOS.begin(); framework != frameworks_iOS.end(); framework++) { std::string id = "Frameworks_" + *framework + "_iphone"; std::string comment = *framework + " in Frameworks"; - ADD_SETTING_ORDER_NOVALUE(iPhone_files, getHash(id), comment, order++); + ADD_SETTING_ORDER_NOVALUE(iOS_files, getHash(id), comment, order++); ADD_BUILD_FILE(id, *framework, getHash(*framework), comment); ADD_FILE_REFERENCE(*framework, *framework, properties[*framework]); } - framework_iPhone->properties["files"] = iPhone_files; + framework_iPhone->properties["files"] = iOS_files; _frameworksBuildPhase.add(framework_iPhone); + ////////////////////////////////////////////////////////////////////////// // ScummVM-OS X Object *framework_OSX = new Object(this, "PBXFrameworksBuildPhase_" + _targets[OSX_TARGET], "PBXFrameworksBuildPhase", "PBXFrameworksBuildPhase", "", "Frameworks"); @@ -553,6 +627,7 @@ void XcodeProvider::setupResourcesBuildPhase() { properties["teenagent.dat"] = FileProperty("file", "", "teenagent.dat", "\"\""); properties["toon.dat"] = FileProperty("file", "", "toon.dat", "\"\""); + properties["Images.xcassets"] = FileProperty("Images.xcassets", "", "Images.xcassets", "\"\""); properties["Default.png"] = FileProperty("image.png", "", "Default.png", "\"\""); properties["icon.png"] = FileProperty("image.png", "", "icon.png", "\"\""); properties["icon-72.png"] = FileProperty("image.png", "", "icon-72.png", "\"\""); @@ -584,6 +659,7 @@ void XcodeProvider::setupResourcesBuildPhase() { files_list.push_back("hugo.dat"); files_list.push_back("teenagent.dat"); files_list.push_back("toon.dat"); + files_list.push_back("Images.xcassets"); int order = 0; for (ValueList::iterator file = files_list.begin(); file != files_list.end(); file++) { @@ -621,6 +697,7 @@ void XcodeProvider::setupSourcesBuildPhase() { // Same as for containers: a rule for each native target for (unsigned int i = 0; i < _targets.size(); i++) { + const std::string &targetName = _targets[i]; Object *source = new Object(this, "PBXSourcesBuildPhase_" + _targets[i], "PBXSourcesBuildPhase", "PBXSourcesBuildPhase", "", "Sources"); source->addProperty("buildActionMask", "2147483647", "", SettingsNoValue); @@ -631,10 +708,14 @@ void XcodeProvider::setupSourcesBuildPhase() { int order = 0; for (std::vector::iterator file = _buildFile.objects.begin(); file !=_buildFile.objects.end(); ++file) { - if (!producesObjectFileOnOSX((*file)->name)) { + const std::string &fileName = (*file)->name; + if (shouldSkipFileForTarget((*file)->id, targetName, fileName)) { + continue; + } + if (!producesObjectFileOnOSX(fileName)) { continue; } - std::string comment = (*file)->name + " in Sources"; + std::string comment = fileName + " in Sources"; ADD_SETTING_ORDER_NOVALUE(files, getHash((*file)->id), comment, order++); } @@ -647,18 +728,26 @@ void XcodeProvider::setupSourcesBuildPhase() { } // Setup all build configurations -void XcodeProvider::setupBuildConfiguration() { +void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { _buildConfiguration.comment = "XCBuildConfiguration"; _buildConfiguration.flags = SettingsAsList; + std::string projectOutputDirectory; +#ifdef POSIX + char *rp = realpath(setup.outputDir.c_str(), NULL); + projectOutputDirectory = rp; + free(rp); +#endif + ///**************************************** // * iPhone // ****************************************/ + // Debug Object *iPhone_Debug_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-iPhone_Debug", _targets[IOS_TARGET] /* ScummVM-iPhone */, "XCBuildConfiguration", "PBXNativeTarget", "Debug"); Property iPhone_Debug; - ADD_SETTING_QUOTE(iPhone_Debug, "ARCHS", "$(ARCHS_UNIVERSAL_IPHONE_OS)"); + ADD_SETTING_QUOTE(iPhone_Debug, "ARCHS", "$(ARCHS_STANDARD)"); ADD_SETTING_QUOTE(iPhone_Debug, "CODE_SIGN_IDENTITY", "iPhone Developer"); ADD_SETTING_QUOTE_VAR(iPhone_Debug, "CODE_SIGN_IDENTITY[sdk=iphoneos*]", "iPhone Developer"); ADD_SETTING(iPhone_Debug, "COMPRESS_PNG_FILES", "NO"); @@ -673,25 +762,29 @@ void XcodeProvider::setupBuildConfiguration() { ADD_SETTING(iPhone_Debug, "GCC_ENABLE_FIX_AND_CONTINUE", "NO"); ADD_SETTING(iPhone_Debug, "GCC_OPTIMIZATION_LEVEL", "0"); ADD_SETTING(iPhone_Debug, "GCC_PRECOMPILE_PREFIX_HEADER", "NO"); + ADD_SETTING(iPhone_Debug, "GCC_WARN_64_TO_32_BIT_CONVERSION", "NO"); ADD_SETTING_QUOTE(iPhone_Debug, "GCC_PREFIX_HEADER", ""); ADD_SETTING(iPhone_Debug, "GCC_THUMB_SUPPORT", "NO"); ADD_SETTING(iPhone_Debug, "GCC_UNROLL_LOOPS", "YES"); ValueList iPhone_HeaderSearchPaths; iPhone_HeaderSearchPaths.push_back("$(SRCROOT)/engines/"); iPhone_HeaderSearchPaths.push_back("$(SRCROOT)"); - iPhone_HeaderSearchPaths.push_back("include/"); + iPhone_HeaderSearchPaths.push_back("\"" + projectOutputDirectory + "\""); + iPhone_HeaderSearchPaths.push_back("\"" + projectOutputDirectory + "/include\""); ADD_SETTING_LIST(iPhone_Debug, "HEADER_SEARCH_PATHS", iPhone_HeaderSearchPaths, SettingsAsList|SettingsQuoteVariable, 5); - ADD_SETTING(iPhone_Debug, "INFOPLIST_FILE", "Info.plist"); + ADD_SETTING_QUOTE(iPhone_Debug, "INFOPLIST_FILE", "$(SRCROOT)/dists/iphone/Info.plist"); ValueList iPhone_LibPaths; iPhone_LibPaths.push_back("$(inherited)"); - iPhone_LibPaths.push_back("\"$(SRCROOT)/lib\""); + iPhone_LibPaths.push_back("\"" + projectOutputDirectory + "/lib\""); ADD_SETTING_LIST(iPhone_Debug, "LIBRARY_SEARCH_PATHS", iPhone_LibPaths, SettingsAsList, 5); ADD_SETTING(iPhone_Debug, "ONLY_ACTIVE_ARCH", "YES"); ADD_SETTING(iPhone_Debug, "PREBINDING", "NO"); ADD_SETTING(iPhone_Debug, "PRODUCT_NAME", PROJECT_DESCRIPTION); - ADD_SETTING_QUOTE(iPhone_Debug, "PROVISIONING_PROFILE", "EF590570-5FAC-4346-9071-D609DE2B28D8"); + ADD_SETTING(iPhone_Debug, "PRODUCT_BUNDLE_IDENTIFIER", "\"org.scummvm.${PRODUCT_NAME}\""); + ADD_SETTING(iPhone_Debug, "IPHONEOS_DEPLOYMENT_TARGET", "9.0"); + //ADD_SETTING_QUOTE(iPhone_Debug, "PROVISIONING_PROFILE", "EF590570-5FAC-4346-9071-D609DE2B28D8"); ADD_SETTING_QUOTE_VAR(iPhone_Debug, "PROVISIONING_PROFILE[sdk=iphoneos*]", ""); - ADD_SETTING(iPhone_Debug, "SDKROOT", "iphoneos4.0"); + ADD_SETTING(iPhone_Debug, "SDKROOT", "iphoneos"); ADD_SETTING_QUOTE(iPhone_Debug, "TARGETED_DEVICE_FAMILY", "1,2"); ValueList scummvmIOS_defines(_defines); REMOVE_DEFINE(scummvmIOS_defines, "MACOSX"); @@ -715,6 +808,7 @@ void XcodeProvider::setupBuildConfiguration() { _buildConfiguration.add(iPhone_Debug_Object); _buildConfiguration.add(iPhone_Release_Object); + /**************************************** * scummvm ****************************************/ diff --git a/devtools/create_project/xcode.h b/devtools/create_project/xcode.h index 366ee803c2..a5f0fc1cf0 100644 --- a/devtools/create_project/xcode.h +++ b/devtools/create_project/xcode.h @@ -314,12 +314,12 @@ private: // Setup objects void setupCopyFilesBuildPhase(); - void setupFrameworksBuildPhase(); + void setupFrameworksBuildPhase(const BuildSetup &setup); void setupNativeTarget(); void setupProject(); void setupResourcesBuildPhase(); void setupSourcesBuildPhase(); - void setupBuildConfiguration(); + void setupBuildConfiguration(const BuildSetup &setup); // Misc void setupDefines(const BuildSetup &setup); // Setup the list of defines to be used on build configurations -- cgit v1.2.3 From c5009aff2442a0f636caee2a07ff96145d0e826c Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 2 Dec 2015 10:10:06 +0100 Subject: IOS: Typo in comment --- devtools/create_project/xcode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 13b6ddad7c..4bbaf57408 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -117,7 +117,7 @@ bool shouldSkipFileForTarget(const std::string &fileID, const std::string &targe } } else { - // Ugly hack: explicitely remove the browser.cpp file. + // Ugly hack: explicitly remove the browser.cpp file. // The problem is that we have only one project for two different targets, // and the parsing of the "mk" files added this file for both targets... if (fileID.length() > 12 && fileID.substr(fileID.length() - 12) == "/browser.cpp") { -- cgit v1.2.3 From c594cfdde1eb4109ad28b6d37b3469123f97e91b Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 2 Dec 2015 10:11:02 +0100 Subject: IOS: Removes "auto", and use an explicit type --- devtools/create_project/xcode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 4bbaf57408..ff1ea9984a 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -37,7 +37,7 @@ namespace CreateProjectTool { defines.push_back(name); #define REMOVE_DEFINE(defines, name) \ - { auto i = std::find(defines.begin(), defines.end(), name); if (i != defines.end()) defines.erase(i); } + { ValueList::iterator i = std::find(defines.begin(), defines.end(), name); if (i != defines.end()) defines.erase(i); } #define ADD_SETTING(config, key, value) \ config.settings[key] = Setting(value, "", SettingsNoQuote); -- cgit v1.2.3 From 2bffce5e72b679f187554bfc00398d7666b3a948 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 2 Dec 2015 11:46:25 +0100 Subject: IOS: Adds the image asset catalog to the iOS targer --- devtools/create_project/xcode.cpp | 24 +++++++++++++++++++++--- devtools/create_project/xcode.h | 11 +++++++++++ 2 files changed, 32 insertions(+), 3 deletions(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index ff1ea9984a..6398bae741 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -258,7 +258,6 @@ XcodeProvider::XcodeProvider(StringList &global_warnings, std::map\""); properties["toon.dat"] = FileProperty("file", "", "toon.dat", "\"\""); - properties["Images.xcassets"] = FileProperty("Images.xcassets", "", "Images.xcassets", "\"\""); properties["Default.png"] = FileProperty("image.png", "", "Default.png", "\"\""); properties["icon.png"] = FileProperty("image.png", "", "icon.png", "\"\""); properties["icon-72.png"] = FileProperty("image.png", "", "icon-72.png", "\"\""); @@ -659,7 +658,6 @@ void XcodeProvider::setupResourcesBuildPhase() { files_list.push_back("hugo.dat"); files_list.push_back("teenagent.dat"); files_list.push_back("toon.dat"); - files_list.push_back("Images.xcassets"); int order = 0; for (ValueList::iterator file = files_list.begin(); file != files_list.end(); file++) { @@ -719,6 +717,8 @@ void XcodeProvider::setupSourcesBuildPhase() { ADD_SETTING_ORDER_NOVALUE(files, getHash((*file)->id), comment, order++); } + addAdditionalSources(targetName, files, order); + source->properties["files"] = files; source->addProperty("runOnlyForDeploymentPostprocessing", "0", "", SettingsNoValue); @@ -791,6 +791,8 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { ADD_DEFINE(scummvmIOS_defines, "IPHONE"); ADD_DEFINE(scummvmIOS_defines, "IPHONE_OFFICIAL"); ADD_SETTING_LIST(iPhone_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmIOS_defines, SettingsNoQuote|SettingsAsList, 5); + ADD_SETTING(iPhone_Debug, "ASSETCATALOG_COMPILER_APPICON_NAME", "AppIcon"); + ADD_SETTING(iPhone_Debug, "ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME", "LaunchImage"); iPhone_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue); iPhone_Debug_Object->properties["buildSettings"] = iPhone_Debug; @@ -961,6 +963,22 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { } } +void XcodeProvider::setupImageAssetCatalog(const BuildSetup &setup) { + const std::string filename = "Images.xcassets"; + const std::string absoluteCatalogPath = _projectRoot + "/dists/iphone/" + filename; + const std::string id = "FileReference_" + absoluteCatalogPath; + Group *group = touchGroupsForPath(absoluteCatalogPath); + group->addChildFile(filename); + addBuildFile(absoluteCatalogPath, filename, getHash(id), "Image Asset Catalog"); +} + +void XcodeProvider::addAdditionalSources(std::string targetName, Property &files, int &order) { + if (targetIsIOS(targetName)) { + const std::string absoluteCatalogPath = _projectRoot + "/dists/iphone/Images.xcassets"; + ADD_SETTING_ORDER_NOVALUE(files, getHash(absoluteCatalogPath), "Image Asset Catalog", order++); + } +} + ////////////////////////////////////////////////////////////////////////// // Misc ////////////////////////////////////////////////////////////////////////// diff --git a/devtools/create_project/xcode.h b/devtools/create_project/xcode.h index a5f0fc1cf0..a4aedb0fac 100644 --- a/devtools/create_project/xcode.h +++ b/devtools/create_project/xcode.h @@ -244,6 +244,15 @@ private: objectMap[obj->id] = true; } + Object *find(std::string id) { + for (std::vector::iterator it = objects.begin(); it != objects.end(); ++it) { + if ((*it)->id == id) { + return *it; + } + } + return NULL; + } + std::string toString() { std::string output; @@ -320,6 +329,8 @@ private: void setupResourcesBuildPhase(); void setupSourcesBuildPhase(); void setupBuildConfiguration(const BuildSetup &setup); + void setupImageAssetCatalog(const BuildSetup &setup); + void addAdditionalSources(std::string targetName, Property &files, int &order); // Misc void setupDefines(const BuildSetup &setup); // Setup the list of defines to be used on build configurations -- cgit v1.2.3 From a9a61cdba59695f0b23524eef201f46f423d6b30 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 2 Dec 2015 12:39:02 +0100 Subject: IOS: Converts spaces to tabs --- devtools/create_project/xcode.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 6398bae741..16fab3d032 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -706,10 +706,10 @@ void XcodeProvider::setupSourcesBuildPhase() { int order = 0; for (std::vector::iterator file = _buildFile.objects.begin(); file !=_buildFile.objects.end(); ++file) { - const std::string &fileName = (*file)->name; - if (shouldSkipFileForTarget((*file)->id, targetName, fileName)) { - continue; - } + const std::string &fileName = (*file)->name; + if (shouldSkipFileForTarget((*file)->id, targetName, fileName)) { + continue; + } if (!producesObjectFileOnOSX(fileName)) { continue; } -- cgit v1.2.3 From ef2903c50972fedc45aba5749a6ce238d0d723a3 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 2 Dec 2015 14:02:13 +0100 Subject: IOS : Rename a function --- devtools/create_project/xcode.cpp | 4 ++-- devtools/create_project/xcode.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 16fab3d032..54f601f144 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -717,7 +717,7 @@ void XcodeProvider::setupSourcesBuildPhase() { ADD_SETTING_ORDER_NOVALUE(files, getHash((*file)->id), comment, order++); } - addAdditionalSources(targetName, files, order); + setupAdditionalSources(targetName, files, order); source->properties["files"] = files; @@ -972,7 +972,7 @@ void XcodeProvider::setupImageAssetCatalog(const BuildSetup &setup) { addBuildFile(absoluteCatalogPath, filename, getHash(id), "Image Asset Catalog"); } -void XcodeProvider::addAdditionalSources(std::string targetName, Property &files, int &order) { +void XcodeProvider::setupAdditionalSources(std::string targetName, Property &files, int &order) { if (targetIsIOS(targetName)) { const std::string absoluteCatalogPath = _projectRoot + "/dists/iphone/Images.xcassets"; ADD_SETTING_ORDER_NOVALUE(files, getHash(absoluteCatalogPath), "Image Asset Catalog", order++); diff --git a/devtools/create_project/xcode.h b/devtools/create_project/xcode.h index a4aedb0fac..08cc8c2618 100644 --- a/devtools/create_project/xcode.h +++ b/devtools/create_project/xcode.h @@ -330,7 +330,7 @@ private: void setupSourcesBuildPhase(); void setupBuildConfiguration(const BuildSetup &setup); void setupImageAssetCatalog(const BuildSetup &setup); - void addAdditionalSources(std::string targetName, Property &files, int &order); + void setupAdditionalSources(std::string targetName, Property &files, int &order); // Misc void setupDefines(const BuildSetup &setup); // Setup the list of defines to be used on build configurations -- cgit v1.2.3 From a8d65195cea6ae0860520f5132faf36781ce135d Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 2 Dec 2015 14:43:54 +0100 Subject: IOS: Adds an helper function --- devtools/create_project/create_project.cpp | 6 ++++++ devtools/create_project/create_project.h | 11 +++++++++++ 2 files changed, 17 insertions(+) (limited to 'devtools/create_project') diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp index b450dafd01..2faf39a340 100644 --- a/devtools/create_project/create_project.cpp +++ b/devtools/create_project/create_project.cpp @@ -1056,6 +1056,12 @@ void splitFilename(const std::string &fileName, std::string &name, std::string & ext = (dot == std::string::npos) ? std::string() : fileName.substr(dot + 1); } +std::string basename(const std::string &fileName) { + const std::string::size_type slash = fileName.find_last_of('/'); + if (slash == std::string::npos) return fileName; + return fileName.substr(slash + 1); +} + bool producesObjectFile(const std::string &fileName) { std::string n, ext; splitFilename(fileName, n, ext); diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h index b81576d4ed..fdcc629382 100644 --- a/devtools/create_project/create_project.h +++ b/devtools/create_project/create_project.h @@ -315,6 +315,17 @@ std::string convertPathToWin(const std::string &path); */ void splitFilename(const std::string &fileName, std::string &name, std::string &ext); +/** + * Returns the basename of a path. + * examples: + * a/b/c/d.ext -> d.ext + * d.ext -> d.ext + * + * @param fileName Filename + * @return The basename + */ +std::string basename(const std::string &fileName); + /** * Checks whether the given file will produce an object file or not. * -- cgit v1.2.3 From 433808b7dc1ba624a2b65558f7f1da921c19d316 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 2 Dec 2015 14:44:10 +0100 Subject: IOS: Properly adds the resource files to the targets --- devtools/create_project/xcode.cpp | 101 ++++++++++++++++++-------------------- devtools/create_project/xcode.h | 3 ++ 2 files changed, 50 insertions(+), 54 deletions(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 54f601f144..c0a1ff09fd 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -95,10 +95,11 @@ bool targetIsIOS(const std::string &targetName) { } bool shouldSkipFileForTarget(const std::string &fileID, const std::string &targetName, const std::string &fileName) { - // There are 3 rules used to determine if a specific file belongs to a target: - // 1) if the parent directory is "backends/platform/iphone", the file belongs to the iOS target. - // 2) if the parent directory is "/sdl", the file belongs to the OS X target. - // 3) if the file has a suffix, like "_osx", or "_ios", the file belongs to one of the target. + // Rules: + // - if the parent directory is "backends/platform/iphone", the file belongs to the iOS target. + // - if the parent directory is "/sdl", the file belongs to the OS X target. + // - if the file has a suffix, like "_osx", or "_ios", the file belongs to one of the target. + // - if the file is an OS X icon file (icns), it belongs to the OS X target. std::string name, ext; splitFilename(fileName, name, ext); if (targetIsIOS(targetName)) { @@ -115,6 +116,9 @@ bool shouldSkipFileForTarget(const std::string &fileID, const std::string &targe || fileID.find(doublebufferdl_directory) != std::string::npos) { return true; } + if (ext == "icns") { + return true; + } } else { // Ugly hack: explicitly remove the browser.cpp file. @@ -260,6 +264,11 @@ XcodeProvider::XcodeProvider(StringList &global_warnings, std::map properties; - properties["scummclassic.zip"] = FileProperty("archive.zip", "", "scummclassic.zip", "\"\""); - properties["scummmodern.zip"] = FileProperty("archive.zip", "", "scummmodern.zip", "\"\""); - - properties["kyra.dat"] = FileProperty("file", "", "kyra.dat", "\"\""); - properties["lure.dat"] = FileProperty("file", "", "lure.dat", "\"\""); - properties["queen.tbl"] = FileProperty("file", "", "queen.tbl", "\"\""); - properties["sky.cpt"] = FileProperty("file", "", "sky.cpt", "\"\""); - properties["drascula.dat"] = FileProperty("file", "", "drascula.dat", "\"\""); - properties["hugo.dat"] = FileProperty("file", "", "hugo.dat", "\"\""); - properties["teenagent.dat"] = FileProperty("file", "", "teenagent.dat", "\"\""); - properties["toon.dat"] = FileProperty("file", "", "toon.dat", "\"\""); - - properties["Default.png"] = FileProperty("image.png", "", "Default.png", "\"\""); - properties["icon.png"] = FileProperty("image.png", "", "icon.png", "\"\""); - properties["icon-72.png"] = FileProperty("image.png", "", "icon-72.png", "\"\""); - properties["icon4.png"] = FileProperty("image.png", "", "icon4.png", "\"\""); + ValueList &files_list = getResourceFiles(); // Same as for containers: a rule for each native target for (unsigned int i = 0; i < _targets.size(); i++) { @@ -643,40 +659,17 @@ void XcodeProvider::setupResourcesBuildPhase() { files.hasOrder = true; files.flags = SettingsAsList; - ValueList files_list; - files_list.push_back("scummclassic.zip"); - files_list.push_back("scummmodern.zip"); - files_list.push_back("kyra.dat"); - files_list.push_back("lure.dat"); - files_list.push_back("queen.tbl"); - files_list.push_back("sky.cpt"); - files_list.push_back("Default.png"); - files_list.push_back("icon.png"); - files_list.push_back("icon-72.png"); - files_list.push_back("icon4.png"); - files_list.push_back("drascula.dat"); - files_list.push_back("hugo.dat"); - files_list.push_back("teenagent.dat"); - files_list.push_back("toon.dat"); - int order = 0; for (ValueList::iterator file = files_list.begin(); file != files_list.end(); file++) { - std::string id = "PBXResources_" + *file; - std::string comment = *file + " in Resources"; - - 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, *file, properties[*file]); - } - - // Add custom files depending on the target - if (_targets[i] == PROJECT_DESCRIPTION "-OS X") { - files.settings[getHash("PBXResources_" PROJECT_NAME ".icns")] = Setting("", PROJECT_NAME ".icns in Resources", SettingsNoValue, 0, 6); - - // Remove 2 iphone icon files - files.settings.erase(getHash("PBXResources_Default.png")); - files.settings.erase(getHash("PBXResources_icon.png")); + if (shouldSkipFileForTarget(*file, _targets[i], *file)) { + continue; + } + std::string resourceAbsolutePath = _projectRoot + "/" + *file; + std::string file_id = "FileReference_" + resourceAbsolutePath; + std::string base = basename(*file); + std::string comment = base + " in Resources"; + addBuildFile(resourceAbsolutePath, base, getHash(file_id), comment); + ADD_SETTING_ORDER_NOVALUE(files, getHash(resourceAbsolutePath), comment, order++); } resource->properties["files"] = files; diff --git a/devtools/create_project/xcode.h b/devtools/create_project/xcode.h index 08cc8c2618..c4cb035b98 100644 --- a/devtools/create_project/xcode.h +++ b/devtools/create_project/xcode.h @@ -335,6 +335,9 @@ private: // Misc void setupDefines(const BuildSetup &setup); // Setup the list of defines to be used on build configurations + // Retrieve information + ValueList& getResourceFiles() const; + // Hash generation std::string getHash(std::string key); std::string newHash() const; -- cgit v1.2.3 From 62e281df263b3f88360d2fb514eb6590eee39c11 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 2 Dec 2015 15:20:33 +0100 Subject: IOS: Changes the deployment target to iOS 7.0 --- devtools/create_project/xcode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index c0a1ff09fd..5c85e43943 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -774,7 +774,7 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { ADD_SETTING(iPhone_Debug, "PREBINDING", "NO"); ADD_SETTING(iPhone_Debug, "PRODUCT_NAME", PROJECT_DESCRIPTION); ADD_SETTING(iPhone_Debug, "PRODUCT_BUNDLE_IDENTIFIER", "\"org.scummvm.${PRODUCT_NAME}\""); - ADD_SETTING(iPhone_Debug, "IPHONEOS_DEPLOYMENT_TARGET", "9.0"); + ADD_SETTING(iPhone_Debug, "IPHONEOS_DEPLOYMENT_TARGET", "7.0"); //ADD_SETTING_QUOTE(iPhone_Debug, "PROVISIONING_PROFILE", "EF590570-5FAC-4346-9071-D609DE2B28D8"); ADD_SETTING_QUOTE_VAR(iPhone_Debug, "PROVISIONING_PROFILE[sdk=iphoneos*]", ""); ADD_SETTING(iPhone_Debug, "SDKROOT", "iphoneos"); -- cgit v1.2.3 From 304bffa90e6d32963d50a7cae64d1a7f186a5a81 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 2 Dec 2015 17:15:31 +0100 Subject: IOS: Once again, changes the iOS deployment target --- devtools/create_project/xcode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 5c85e43943..8e2ab4c04d 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -774,7 +774,7 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { ADD_SETTING(iPhone_Debug, "PREBINDING", "NO"); ADD_SETTING(iPhone_Debug, "PRODUCT_NAME", PROJECT_DESCRIPTION); ADD_SETTING(iPhone_Debug, "PRODUCT_BUNDLE_IDENTIFIER", "\"org.scummvm.${PRODUCT_NAME}\""); - ADD_SETTING(iPhone_Debug, "IPHONEOS_DEPLOYMENT_TARGET", "7.0"); + ADD_SETTING(iPhone_Debug, "IPHONEOS_DEPLOYMENT_TARGET", "7.1"); //ADD_SETTING_QUOTE(iPhone_Debug, "PROVISIONING_PROFILE", "EF590570-5FAC-4346-9071-D609DE2B28D8"); ADD_SETTING_QUOTE_VAR(iPhone_Debug, "PROVISIONING_PROFILE[sdk=iphoneos*]", ""); ADD_SETTING(iPhone_Debug, "SDKROOT", "iphoneos"); -- cgit v1.2.3 From c1e664b6d681e4f59de361457e7487c138aaf31f Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Thu, 3 Dec 2015 07:13:15 +0100 Subject: IOS: Replaces spaces with tabs --- devtools/create_project/xcode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 8e2ab4c04d..46e6bcd41b 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -755,7 +755,7 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { ADD_SETTING(iPhone_Debug, "GCC_ENABLE_FIX_AND_CONTINUE", "NO"); ADD_SETTING(iPhone_Debug, "GCC_OPTIMIZATION_LEVEL", "0"); ADD_SETTING(iPhone_Debug, "GCC_PRECOMPILE_PREFIX_HEADER", "NO"); - ADD_SETTING(iPhone_Debug, "GCC_WARN_64_TO_32_BIT_CONVERSION", "NO"); + ADD_SETTING(iPhone_Debug, "GCC_WARN_64_TO_32_BIT_CONVERSION", "NO"); ADD_SETTING_QUOTE(iPhone_Debug, "GCC_PREFIX_HEADER", ""); ADD_SETTING(iPhone_Debug, "GCC_THUMB_SUPPORT", "NO"); ADD_SETTING(iPhone_Debug, "GCC_UNROLL_LOOPS", "YES"); -- cgit v1.2.3 From 43f02471ea48806fda697380b82dcfd34f993ae1 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Fri, 4 Dec 2015 10:27:48 +0100 Subject: IOS: Fixes a crash of the create_project tool when the lib directory is not found --- devtools/create_project/xcode.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 46e6bcd41b..02f2928bf9 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -443,7 +443,8 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) { std::string absoluteOutputDir; #ifdef POSIX - absoluteOutputDir = realpath((setup.outputDir + "/lib").c_str(), NULL); + absoluteOutputDir = realpath(setup.outputDir.c_str(), NULL); + absoluteOutputDir += "/lib"; #else absoluteOutputDir = "lib"; #endif -- cgit v1.2.3 From 99844a81b03645e2c5a94d524f275f6e85977eef Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Fri, 4 Dec 2015 11:50:03 +0100 Subject: IOS: Replaces whitespaces with tab --- devtools/create_project/xcode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 02f2928bf9..90eea39aaf 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -444,7 +444,7 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) { std::string absoluteOutputDir; #ifdef POSIX absoluteOutputDir = realpath(setup.outputDir.c_str(), NULL); - absoluteOutputDir += "/lib"; + absoluteOutputDir += "/lib"; #else absoluteOutputDir = "lib"; #endif -- cgit v1.2.3 From cfa9172a6e8543f16c2bbdbb1477bc47dec7f128 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Fri, 4 Dec 2015 12:26:14 +0100 Subject: IOS: Fixes a small memory leak --- devtools/create_project/xcode.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 90eea39aaf..66fd8c49f3 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -443,8 +443,10 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) { std::string absoluteOutputDir; #ifdef POSIX - absoluteOutputDir = realpath(setup.outputDir.c_str(), NULL); + char *c_path = realpath(setup.outputDir.c_str(), NULL); + absoluteOutputDir = c_path; absoluteOutputDir += "/lib"; + free(c_path); #else absoluteOutputDir = "lib"; #endif -- cgit v1.2.3 From d265b80fbf1cd8d0dbe3f1606c6e0e26324d1330 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Fri, 4 Dec 2015 12:26:31 +0100 Subject: IOS: Removes an unused local variable --- devtools/create_project/xcode.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 66fd8c49f3..2914920fd3 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -686,9 +686,6 @@ void XcodeProvider::setupResourcesBuildPhase() { void XcodeProvider::setupSourcesBuildPhase() { _sourcesBuildPhase.comment = "PBXSourcesBuildPhase"; - // Setup source file properties - std::map properties; - // Same as for containers: a rule for each native target for (unsigned int i = 0; i < _targets.size(); i++) { const std::string &targetName = _targets[i]; -- cgit v1.2.3 From 638dc113f8c05f121d50e68f68c4e86c130756a4 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Fri, 4 Dec 2015 18:20:09 +0100 Subject: IOS: Create two targets for old iPhone (iOS <= 6) and new one (iOS >= 7) The "iphone" backend is the support for the old iPhones. The "ios7" backend is for the new iPhones. --- devtools/create_project/xcode.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 2914920fd3..8365114863 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -96,7 +96,7 @@ bool targetIsIOS(const std::string &targetName) { bool shouldSkipFileForTarget(const std::string &fileID, const std::string &targetName, const std::string &fileName) { // Rules: - // - if the parent directory is "backends/platform/iphone", the file belongs to the iOS target. + // - if the parent directory is "backends/platform/ios7", the file belongs to the iOS target. // - if the parent directory is "/sdl", the file belongs to the OS X target. // - if the file has a suffix, like "_osx", or "_ios", the file belongs to one of the target. // - if the file is an OS X icon file (icns), it belongs to the OS X target. @@ -133,7 +133,7 @@ bool shouldSkipFileForTarget(const std::string &fileID, const std::string &targe } // parent directory const std::string directory = fileID.substr(0, fileID.length() - fileName.length()); - static const std::string iphone_directory = "backends/platform/iphone"; + static const std::string iphone_directory = "backends/platform/ios7"; if (directory.length() > iphone_directory.length() && directory.substr(directory.length() - iphone_directory.length()) == iphone_directory) { return true; } @@ -262,7 +262,7 @@ XcodeProvider::XcodeProvider(StringList &global_warnings, std::mapaddChildFile(filename); @@ -967,7 +967,7 @@ void XcodeProvider::setupImageAssetCatalog(const BuildSetup &setup) { void XcodeProvider::setupAdditionalSources(std::string targetName, Property &files, int &order) { if (targetIsIOS(targetName)) { - const std::string absoluteCatalogPath = _projectRoot + "/dists/iphone/Images.xcassets"; + const std::string absoluteCatalogPath = _projectRoot + "/dists/ios7/Images.xcassets"; ADD_SETTING_ORDER_NOVALUE(files, getHash(absoluteCatalogPath), "Image Asset Catalog", order++); } } -- cgit v1.2.3 From 616ec2a924d8abec680f1106beb7dd7af6d6c350 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Mon, 7 Dec 2015 10:13:25 +0100 Subject: IOS: Fixes Xcode group paths The generated project paths were recognized by Xcode, but not third party tools, like AppCode. --- devtools/create_project/xcode.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 8365114863..b3129a538c 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -142,8 +142,9 @@ bool shouldSkipFileForTarget(const std::string &fileID, const std::string &targe } XcodeProvider::Group::Group(XcodeProvider *objectParent, const std::string &groupName, const std::string &uniqueName, const std::string &path) : Object(objectParent, uniqueName, groupName, "PBXGroup", "", groupName) { + bool path_is_absolute = (path.length() > 0 && path.at(0) == '/'); addProperty("name", name, "", SettingsNoValue|SettingsQuoteVariable); - addProperty("sourceTree", "", "", SettingsNoValue|SettingsQuoteVariable); + addProperty("sourceTree", path_is_absolute ? "" : "", "", SettingsNoValue|SettingsQuoteVariable); if (path != "") { addProperty("path", path, "", SettingsNoValue|SettingsQuoteVariable); -- cgit v1.2.3 From bb9e2b97df419eaa7a3bc25f87ab624503a512f5 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Mon, 7 Dec 2015 10:38:07 +0100 Subject: IOS: More Xcode path fixed --- devtools/create_project/xcode.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index b3129a538c..d7cd40b65d 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -392,10 +392,10 @@ 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_PATH(path,lib) properties[lib".a"] = FileProperty("archive.ar", lib ".a", path, "\"\""); \ +#define DEF_LOCALLIB_STATIC_PATH(path,lib,absolute) properties[lib".a"] = FileProperty("archive.ar", lib ".a", path, (absolute ? "\"\"" : "\"\"")); \ ADD_SETTING_ORDER_NOVALUE(children, getHash(lib".a"), lib".a", fwOrder++); -#define DEF_LOCALLIB_STATIC(lib) DEF_LOCALLIB_STATIC_PATH("/opt/local/lib/" lib ".a", lib) +#define DEF_LOCALLIB_STATIC(lib) DEF_LOCALLIB_STATIC_PATH("/opt/local/lib/" lib ".a", lib, true) /** @@ -452,11 +452,11 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) { absoluteOutputDir = "lib"; #endif - DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libFLACiOS.a", "libFLACiOS"); - DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libFreetype2.a", "libFreetype2"); - DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libogg.a", "libogg"); - DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libpng.a", "libpng"); - DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libvorbis.a", "libvorbis"); + DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libFLACiOS.a", "libFLACiOS", true); + DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libFreetype2.a", "libFreetype2", true); + DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libogg.a", "libogg", true); + DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libpng.a", "libpng", true); + DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libvorbis.a", "libvorbis", true); frameworksGroup->properties["children"] = children; _groups.add(frameworksGroup); -- cgit v1.2.3 From 907af3fe038198a7937f1355c1131a01ffbe67df Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Mon, 7 Dec 2015 10:39:38 +0100 Subject: IOS: Modernize Xcode project --- devtools/create_project/xcode.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index d7cd40b65d..640ad8a209 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -241,7 +241,7 @@ void XcodeProvider::addFileReference(const std::string &id, const std::string &n void XcodeProvider::addProductFileReference(const std::string &id, const std::string &name) { Object *fileRef = new Object(this, id, name, "PBXFileReference", "PBXFileReference", name); - fileRef->addProperty("explicitFileType", "compiled.mach-o.executable", "", SettingsNoValue|SettingsQuoteVariable); + fileRef->addProperty("explicitFileType", "wrapper.application", "", SettingsNoValue|SettingsQuoteVariable); fileRef->addProperty("includeInIndex", "0", "", SettingsNoValue); fileRef->addProperty("path", name, "", SettingsNoValue|SettingsQuoteVariable); fileRef->addProperty("sourceTree", "BUILT_PRODUCTS_DIR", "", SettingsNoValue); @@ -741,7 +741,6 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { // Debug Object *iPhone_Debug_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-iPhone_Debug", _targets[IOS_TARGET] /* ScummVM-iPhone */, "XCBuildConfiguration", "PBXNativeTarget", "Debug"); Property iPhone_Debug; - ADD_SETTING_QUOTE(iPhone_Debug, "ARCHS", "$(ARCHS_STANDARD)"); ADD_SETTING_QUOTE(iPhone_Debug, "CODE_SIGN_IDENTITY", "iPhone Developer"); ADD_SETTING_QUOTE_VAR(iPhone_Debug, "CODE_SIGN_IDENTITY[sdk=iphoneos*]", "iPhone Developer"); ADD_SETTING(iPhone_Debug, "COMPRESS_PNG_FILES", "NO"); @@ -787,6 +786,7 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { ADD_SETTING_LIST(iPhone_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmIOS_defines, SettingsNoQuote|SettingsAsList, 5); ADD_SETTING(iPhone_Debug, "ASSETCATALOG_COMPILER_APPICON_NAME", "AppIcon"); ADD_SETTING(iPhone_Debug, "ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME", "LaunchImage"); + ADD_SETTING(iPhone_Debug, "ENABLE_TESTABILITY", "YES"); iPhone_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue); iPhone_Debug_Object->properties["buildSettings"] = iPhone_Debug; @@ -797,6 +797,7 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { ADD_SETTING(iPhone_Release, "GCC_OPTIMIZATION_LEVEL", "3"); ADD_SETTING(iPhone_Release, "COPY_PHASE_STRIP", "YES"); REMOVE_SETTING(iPhone_Release, "GCC_DYNAMIC_NO_PIC"); + REMOVE_SETTING(iPhone_Release, "ENABLE_TESTABILITY"); ADD_SETTING(iPhone_Release, "WRAPPER_EXTENSION", "app"); iPhone_Release_Object->addProperty("name", "Release", "", SettingsNoValue); @@ -814,7 +815,6 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { Property scummvm_Debug; ADD_SETTING(scummvm_Debug, "ALWAYS_SEARCH_USER_PATHS", "NO"); ADD_SETTING_QUOTE(scummvm_Debug, "USER_HEADER_SEARCH_PATHS", "$(SRCROOT) $(SRCROOT)/engines"); - ADD_SETTING_QUOTE(scummvm_Debug, "ARCHS", "$(ARCHS_STANDARD_32_BIT)"); ADD_SETTING_QUOTE(scummvm_Debug, "CODE_SIGN_IDENTITY", "Don't Code Sign"); ADD_SETTING_QUOTE_VAR(scummvm_Debug, "CODE_SIGN_IDENTITY[sdk=iphoneos*]", "Don't Code Sign"); ADD_SETTING_QUOTE(scummvm_Debug, "FRAMEWORK_SEARCH_PATHS", ""); @@ -843,6 +843,7 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { ADD_SETTING_QUOTE(scummvm_Debug, "OTHER_LDFLAGS", "-lz"); ADD_SETTING(scummvm_Debug, "PREBINDING", "NO"); ADD_SETTING(scummvm_Debug, "SDKROOT", "macosx"); + ADD_SETTING(scummvm_Debug, "ENABLE_TESTABILITY", "YES"); scummvm_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue); scummvm_Debug_Object->properties["buildSettings"] = scummvm_Debug; @@ -854,6 +855,7 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { REMOVE_SETTING(scummvm_Release, "GCC_WARN_ABOUT_RETURN_TYPE"); REMOVE_SETTING(scummvm_Release, "GCC_WARN_UNUSED_VARIABLE"); REMOVE_SETTING(scummvm_Release, "ONLY_ACTIVE_ARCH"); + REMOVE_SETTING(scummvm_Release, "ENABLE_TESTABILITY"); scummvm_Release_Object->addProperty("name", "Release", "", SettingsNoValue); scummvm_Release_Object->properties["buildSettings"] = scummvm_Release; @@ -868,7 +870,7 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { // Debug Object *scummvmOSX_Debug_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-OSX_Debug", _targets[OSX_TARGET] /* ScummVM-OS X */, "XCBuildConfiguration", "PBXNativeTarget", "Debug"); Property scummvmOSX_Debug; - ADD_SETTING_QUOTE(scummvmOSX_Debug, "ARCHS", "$(NATIVE_ARCH)"); + ADD_SETTING(scummvmOSX_Debug, "COMBINE_HIDPI_IMAGES", "YES"); ADD_SETTING(scummvmOSX_Debug, "COMPRESS_PNG_FILES", "NO"); ADD_SETTING(scummvmOSX_Debug, "COPY_PHASE_STRIP", "NO"); ADD_SETTING_QUOTE(scummvmOSX_Debug, "DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym"); -- cgit v1.2.3 From ce1b955dda2ad845419cb2373cd58452930776ff Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Mon, 7 Dec 2015 11:34:05 +0100 Subject: IOS: Cleanup preprocessor macros --- devtools/create_project/xcode.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 640ad8a209..92788d4f30 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -779,8 +779,8 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { ADD_SETTING_QUOTE_VAR(iPhone_Debug, "PROVISIONING_PROFILE[sdk=iphoneos*]", ""); ADD_SETTING(iPhone_Debug, "SDKROOT", "iphoneos"); ADD_SETTING_QUOTE(iPhone_Debug, "TARGETED_DEVICE_FAMILY", "1,2"); - ValueList scummvmIOS_defines(_defines); - REMOVE_DEFINE(scummvmIOS_defines, "MACOSX"); + ValueList scummvmIOS_defines; + ADD_DEFINE(scummvmIOS_defines, "\"$(inherited)\""); ADD_DEFINE(scummvmIOS_defines, "IPHONE"); ADD_DEFINE(scummvmIOS_defines, "IPHONE_OFFICIAL"); ADD_SETTING_LIST(iPhone_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmIOS_defines, SettingsNoQuote|SettingsAsList, 5); @@ -826,7 +826,8 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { ValueList scummvm_defines(_defines); REMOVE_DEFINE(scummvm_defines, "MACOSX"); REMOVE_DEFINE(scummvm_defines, "IPHONE"); - ADD_DEFINE(scummvm_defines, "XCODE"); + REMOVE_DEFINE(scummvm_defines, "IPHONE_OFFICIAL"); + REMOVE_DEFINE(scummvm_defines, "SDL_BACKEND"); ADD_SETTING_LIST(scummvm_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, SettingsNoQuote|SettingsAsList, 5); ADD_SETTING(scummvm_Debug, "GCC_THUMB_SUPPORT", "NO"); ADD_SETTING(scummvm_Debug, "GCC_USE_GCC3_PFE_SUPPORT", "NO"); @@ -883,8 +884,8 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { ADD_SETTING(scummvmOSX_Debug, "GCC_OPTIMIZATION_LEVEL", "0"); ADD_SETTING(scummvmOSX_Debug, "GCC_PRECOMPILE_PREFIX_HEADER", "NO"); ADD_SETTING_QUOTE(scummvmOSX_Debug, "GCC_PREFIX_HEADER", ""); - ValueList scummvmOSX_defines(_defines); - REMOVE_DEFINE(scummvmOSX_defines, "IPHONE"); + ValueList scummvmOSX_defines; + ADD_DEFINE(scummvmOSX_defines, "\"$(inherited)\""); ADD_DEFINE(scummvmOSX_defines, "SDL_BACKEND"); ADD_DEFINE(scummvmOSX_defines, "MACOSX"); ADD_SETTING_LIST(scummvmOSX_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmOSX_defines, SettingsNoQuote|SettingsAsList, 5); @@ -989,10 +990,13 @@ void XcodeProvider::setupDefines(const BuildSetup &setup) { ADD_DEFINE(_defines, *i); } // Add special defines for Mac support + REMOVE_DEFINE(_defines, "MACOSX"); + REMOVE_DEFINE(_defines, "IPHONE"); + REMOVE_DEFINE(_defines, "IPHONE_OFFICIAL"); + REMOVE_DEFINE(_defines, "SDL_BACKEND"); ADD_DEFINE(_defines, "CONFIG_H"); - ADD_DEFINE(_defines, "SCUMM_NEED_ALIGNMENT"); - ADD_DEFINE(_defines, "SCUMM_LITTLE_ENDIAN"); ADD_DEFINE(_defines, "UNIX"); + ADD_DEFINE(_defines, "XCODE"); ADD_DEFINE(_defines, "SCUMMVM"); } -- cgit v1.2.3 From 481884e778071c1e071c68c4bc03752bed04bccd Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Tue, 8 Dec 2015 12:11:31 +0100 Subject: IOS: Fixes small issues about the project name --- devtools/create_project/xcode.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 92788d4f30..abeeb1ff44 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -607,6 +607,7 @@ void XcodeProvider::setupProject() { project->properties["knownRegions"] = regions; project->addProperty("mainGroup", _rootSourceGroup->getHashRef(), "CustomTemplate", SettingsNoValue); + project->addProperty("productRefGroup", getHash("PBXGroup_CustomTemplate_Products_"), "" , SettingsNoValue); project->addProperty("projectDirPath", _projectRoot, "", SettingsNoValue|SettingsQuoteVariable); project->addProperty("projectRoot", "", "", SettingsNoValue|SettingsQuoteVariable); @@ -772,7 +773,7 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { ADD_SETTING_LIST(iPhone_Debug, "LIBRARY_SEARCH_PATHS", iPhone_LibPaths, SettingsAsList, 5); ADD_SETTING(iPhone_Debug, "ONLY_ACTIVE_ARCH", "YES"); ADD_SETTING(iPhone_Debug, "PREBINDING", "NO"); - ADD_SETTING(iPhone_Debug, "PRODUCT_NAME", PROJECT_DESCRIPTION); + ADD_SETTING(iPhone_Debug, "PRODUCT_NAME", PROJECT_NAME); ADD_SETTING(iPhone_Debug, "PRODUCT_BUNDLE_IDENTIFIER", "\"org.scummvm.${PRODUCT_NAME}\""); ADD_SETTING(iPhone_Debug, "IPHONEOS_DEPLOYMENT_TARGET", "7.1"); //ADD_SETTING_QUOTE(iPhone_Debug, "PROVISIONING_PROFILE", "EF590570-5FAC-4346-9071-D609DE2B28D8"); @@ -921,7 +922,7 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { scummvmOSX_LdFlags.push_back("-lz"); ADD_SETTING_LIST(scummvmOSX_Debug, "OTHER_LDFLAGS", scummvmOSX_LdFlags, SettingsAsList, 5); ADD_SETTING(scummvmOSX_Debug, "PREBINDING", "NO"); - ADD_SETTING(scummvmOSX_Debug, "PRODUCT_NAME", PROJECT_DESCRIPTION); + ADD_SETTING(scummvmOSX_Debug, "PRODUCT_NAME", PROJECT_NAME); scummvmOSX_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue); scummvmOSX_Debug_Object->properties["buildSettings"] = scummvmOSX_Debug; -- cgit v1.2.3 From 84c603bbb3d5d9c8945f5823a4a0ef3eb8dd4bf9 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 9 Dec 2015 14:17:02 +0100 Subject: IOS: Cleanup Xcode settings --- devtools/create_project/xcode.cpp | 123 +++++++++++++++++++------------------- 1 file changed, 61 insertions(+), 62 deletions(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index abeeb1ff44..8c8289767b 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -735,8 +735,65 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { free(rp); #endif + /**************************************** + * ScummVM - Project Level + ****************************************/ + + // Debug + Object *scummvm_Debug_Object = new Object(this, "XCBuildConfiguration_" PROJECT_NAME "_Debug", PROJECT_NAME, "XCBuildConfiguration", "PBXProject", "Debug"); + Property scummvm_Debug; + ADD_SETTING(scummvm_Debug, "ALWAYS_SEARCH_USER_PATHS", "NO"); + ADD_SETTING_QUOTE(scummvm_Debug, "USER_HEADER_SEARCH_PATHS", "$(SRCROOT) $(SRCROOT)/engines"); + ADD_SETTING_QUOTE(scummvm_Debug, "CODE_SIGN_IDENTITY", "Don't Code Sign"); + ADD_SETTING_QUOTE_VAR(scummvm_Debug, "CODE_SIGN_IDENTITY[sdk=iphoneos*]", "Don't Code Sign"); + ADD_SETTING_QUOTE(scummvm_Debug, "FRAMEWORK_SEARCH_PATHS", ""); + ADD_SETTING(scummvm_Debug, "GCC_C_LANGUAGE_STANDARD", "c99"); + ADD_SETTING(scummvm_Debug, "GCC_ENABLE_CPP_EXCEPTIONS", "NO"); + ADD_SETTING(scummvm_Debug, "GCC_ENABLE_CPP_RTTI", "YES"); + ADD_SETTING(scummvm_Debug, "GCC_INPUT_FILETYPE", "automatic"); + ADD_SETTING(scummvm_Debug, "GCC_OPTIMIZATION_LEVEL", "0"); + ValueList scummvm_defines(_defines); + REMOVE_DEFINE(scummvm_defines, "MACOSX"); + REMOVE_DEFINE(scummvm_defines, "IPHONE"); + REMOVE_DEFINE(scummvm_defines, "IPHONE_OFFICIAL"); + REMOVE_DEFINE(scummvm_defines, "SDL_BACKEND"); + ADD_SETTING_LIST(scummvm_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, SettingsNoQuote|SettingsAsList, 5); + ADD_SETTING(scummvm_Debug, "GCC_THUMB_SUPPORT", "NO"); + ADD_SETTING(scummvm_Debug, "GCC_USE_GCC3_PFE_SUPPORT", "NO"); + ADD_SETTING(scummvm_Debug, "GCC_WARN_ABOUT_RETURN_TYPE", "YES"); + ADD_SETTING(scummvm_Debug, "GCC_WARN_UNUSED_VARIABLE", "YES"); + ValueList scummvm_HeaderPaths; + scummvm_HeaderPaths.push_back("include/"); + scummvm_HeaderPaths.push_back("$(SRCROOT)/engines/"); + scummvm_HeaderPaths.push_back("$(SRCROOT)"); + ADD_SETTING_LIST(scummvm_Debug, "HEADER_SEARCH_PATHS", scummvm_HeaderPaths, SettingsQuoteVariable|SettingsAsList, 5); + ADD_SETTING_QUOTE(scummvm_Debug, "LIBRARY_SEARCH_PATHS", ""); + ADD_SETTING(scummvm_Debug, "ONLY_ACTIVE_ARCH", "YES"); + ADD_SETTING_QUOTE(scummvm_Debug, "OTHER_CFLAGS", ""); + ADD_SETTING_QUOTE(scummvm_Debug, "OTHER_LDFLAGS", "-lz"); + ADD_SETTING(scummvm_Debug, "PREBINDING", "NO"); + ADD_SETTING(scummvm_Debug, "ENABLE_TESTABILITY", "YES"); + + scummvm_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue); + scummvm_Debug_Object->properties["buildSettings"] = scummvm_Debug; + + // Release + Object *scummvm_Release_Object = new Object(this, "XCBuildConfiguration_" PROJECT_NAME "_Release", PROJECT_NAME, "XCBuildConfiguration", "PBXProject", "Release"); + Property scummvm_Release(scummvm_Debug); + REMOVE_SETTING(scummvm_Release, "GCC_C_LANGUAGE_STANDARD"); // Not sure why we remove that, or any of the other warnings + REMOVE_SETTING(scummvm_Release, "GCC_WARN_ABOUT_RETURN_TYPE"); + REMOVE_SETTING(scummvm_Release, "GCC_WARN_UNUSED_VARIABLE"); + REMOVE_SETTING(scummvm_Release, "ONLY_ACTIVE_ARCH"); + REMOVE_SETTING(scummvm_Release, "ENABLE_TESTABILITY"); + + scummvm_Release_Object->addProperty("name", "Release", "", SettingsNoValue); + scummvm_Release_Object->properties["buildSettings"] = scummvm_Release; + + _buildConfiguration.add(scummvm_Debug_Object); + _buildConfiguration.add(scummvm_Release_Object); + ///**************************************** - // * iPhone + // * ScummVM - iOS Target // ****************************************/ // Debug @@ -757,6 +814,7 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { ADD_SETTING(iPhone_Debug, "GCC_OPTIMIZATION_LEVEL", "0"); ADD_SETTING(iPhone_Debug, "GCC_PRECOMPILE_PREFIX_HEADER", "NO"); ADD_SETTING(iPhone_Debug, "GCC_WARN_64_TO_32_BIT_CONVERSION", "NO"); + ADD_SETTING(iPhone_Debug, "WARNING_CFLAGS", "-Wno-multichar"); ADD_SETTING_QUOTE(iPhone_Debug, "GCC_PREFIX_HEADER", ""); ADD_SETTING(iPhone_Debug, "GCC_THUMB_SUPPORT", "NO"); ADD_SETTING(iPhone_Debug, "GCC_UNROLL_LOOPS", "YES"); @@ -787,7 +845,6 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { ADD_SETTING_LIST(iPhone_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmIOS_defines, SettingsNoQuote|SettingsAsList, 5); ADD_SETTING(iPhone_Debug, "ASSETCATALOG_COMPILER_APPICON_NAME", "AppIcon"); ADD_SETTING(iPhone_Debug, "ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME", "LaunchImage"); - ADD_SETTING(iPhone_Debug, "ENABLE_TESTABILITY", "YES"); iPhone_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue); iPhone_Debug_Object->properties["buildSettings"] = iPhone_Debug; @@ -798,7 +855,6 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { ADD_SETTING(iPhone_Release, "GCC_OPTIMIZATION_LEVEL", "3"); ADD_SETTING(iPhone_Release, "COPY_PHASE_STRIP", "YES"); REMOVE_SETTING(iPhone_Release, "GCC_DYNAMIC_NO_PIC"); - REMOVE_SETTING(iPhone_Release, "ENABLE_TESTABILITY"); ADD_SETTING(iPhone_Release, "WRAPPER_EXTENSION", "app"); iPhone_Release_Object->addProperty("name", "Release", "", SettingsNoValue); @@ -808,71 +864,14 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { _buildConfiguration.add(iPhone_Release_Object); /**************************************** - * scummvm - ****************************************/ - - // Debug - Object *scummvm_Debug_Object = new Object(this, "XCBuildConfiguration_" PROJECT_NAME "_Debug", PROJECT_NAME, "XCBuildConfiguration", "PBXProject", "Debug"); - Property scummvm_Debug; - ADD_SETTING(scummvm_Debug, "ALWAYS_SEARCH_USER_PATHS", "NO"); - ADD_SETTING_QUOTE(scummvm_Debug, "USER_HEADER_SEARCH_PATHS", "$(SRCROOT) $(SRCROOT)/engines"); - ADD_SETTING_QUOTE(scummvm_Debug, "CODE_SIGN_IDENTITY", "Don't Code Sign"); - ADD_SETTING_QUOTE_VAR(scummvm_Debug, "CODE_SIGN_IDENTITY[sdk=iphoneos*]", "Don't Code Sign"); - ADD_SETTING_QUOTE(scummvm_Debug, "FRAMEWORK_SEARCH_PATHS", ""); - ADD_SETTING(scummvm_Debug, "GCC_C_LANGUAGE_STANDARD", "c99"); - ADD_SETTING(scummvm_Debug, "GCC_ENABLE_CPP_EXCEPTIONS", "NO"); - ADD_SETTING(scummvm_Debug, "GCC_ENABLE_CPP_RTTI", "YES"); - ADD_SETTING(scummvm_Debug, "GCC_INPUT_FILETYPE", "automatic"); - ADD_SETTING(scummvm_Debug, "GCC_OPTIMIZATION_LEVEL", "0"); - ValueList scummvm_defines(_defines); - REMOVE_DEFINE(scummvm_defines, "MACOSX"); - REMOVE_DEFINE(scummvm_defines, "IPHONE"); - REMOVE_DEFINE(scummvm_defines, "IPHONE_OFFICIAL"); - REMOVE_DEFINE(scummvm_defines, "SDL_BACKEND"); - ADD_SETTING_LIST(scummvm_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, SettingsNoQuote|SettingsAsList, 5); - ADD_SETTING(scummvm_Debug, "GCC_THUMB_SUPPORT", "NO"); - ADD_SETTING(scummvm_Debug, "GCC_USE_GCC3_PFE_SUPPORT", "NO"); - ADD_SETTING(scummvm_Debug, "GCC_WARN_ABOUT_RETURN_TYPE", "YES"); - ADD_SETTING(scummvm_Debug, "GCC_WARN_UNUSED_VARIABLE", "YES"); - ValueList scummvm_HeaderPaths; - scummvm_HeaderPaths.push_back("include/"); - scummvm_HeaderPaths.push_back("$(SRCROOT)/engines/"); - scummvm_HeaderPaths.push_back("$(SRCROOT)"); - ADD_SETTING_LIST(scummvm_Debug, "HEADER_SEARCH_PATHS", scummvm_HeaderPaths, SettingsQuoteVariable|SettingsAsList, 5); - ADD_SETTING_QUOTE(scummvm_Debug, "LIBRARY_SEARCH_PATHS", ""); - ADD_SETTING(scummvm_Debug, "ONLY_ACTIVE_ARCH", "YES"); - ADD_SETTING_QUOTE(scummvm_Debug, "OTHER_CFLAGS", ""); - ADD_SETTING_QUOTE(scummvm_Debug, "OTHER_LDFLAGS", "-lz"); - ADD_SETTING(scummvm_Debug, "PREBINDING", "NO"); - ADD_SETTING(scummvm_Debug, "SDKROOT", "macosx"); - ADD_SETTING(scummvm_Debug, "ENABLE_TESTABILITY", "YES"); - - scummvm_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue); - scummvm_Debug_Object->properties["buildSettings"] = scummvm_Debug; - - // Release - Object *scummvm_Release_Object = new Object(this, "XCBuildConfiguration_" PROJECT_NAME "_Release", PROJECT_NAME, "XCBuildConfiguration", "PBXProject", "Release"); - Property scummvm_Release(scummvm_Debug); - REMOVE_SETTING(scummvm_Release, "GCC_C_LANGUAGE_STANDARD"); // Not sure why we remove that, or any of the other warnings - REMOVE_SETTING(scummvm_Release, "GCC_WARN_ABOUT_RETURN_TYPE"); - REMOVE_SETTING(scummvm_Release, "GCC_WARN_UNUSED_VARIABLE"); - REMOVE_SETTING(scummvm_Release, "ONLY_ACTIVE_ARCH"); - REMOVE_SETTING(scummvm_Release, "ENABLE_TESTABILITY"); - - scummvm_Release_Object->addProperty("name", "Release", "", SettingsNoValue); - scummvm_Release_Object->properties["buildSettings"] = scummvm_Release; - - _buildConfiguration.add(scummvm_Debug_Object); - _buildConfiguration.add(scummvm_Release_Object); - - /**************************************** - * ScummVM-OS X + * ScummVM - OS X Target ****************************************/ // Debug Object *scummvmOSX_Debug_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-OSX_Debug", _targets[OSX_TARGET] /* ScummVM-OS X */, "XCBuildConfiguration", "PBXNativeTarget", "Debug"); Property scummvmOSX_Debug; ADD_SETTING(scummvmOSX_Debug, "COMBINE_HIDPI_IMAGES", "YES"); + ADD_SETTING(scummvmOSX_Debug, "SDKROOT", "macosx"); ADD_SETTING(scummvmOSX_Debug, "COMPRESS_PNG_FILES", "NO"); ADD_SETTING(scummvmOSX_Debug, "COPY_PHASE_STRIP", "NO"); ADD_SETTING_QUOTE(scummvmOSX_Debug, "DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym"); -- cgit v1.2.3 From 66c195f55e0ddb1130a40219452287ea9165c84d Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 9 Dec 2015 15:12:49 +0100 Subject: IOS: Changes the debug information format Mainly, to speed up the development with the "debug" configuration. --- devtools/create_project/xcode.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 8c8289767b..db91bb873d 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -803,7 +803,7 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { ADD_SETTING_QUOTE_VAR(iPhone_Debug, "CODE_SIGN_IDENTITY[sdk=iphoneos*]", "iPhone Developer"); ADD_SETTING(iPhone_Debug, "COMPRESS_PNG_FILES", "NO"); ADD_SETTING(iPhone_Debug, "COPY_PHASE_STRIP", "NO"); - ADD_SETTING_QUOTE(iPhone_Debug, "DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym"); + ADD_SETTING_QUOTE(iPhone_Debug, "DEBUG_INFORMATION_FORMAT", "dwarf"); ValueList iPhone_FrameworkSearchPaths; iPhone_FrameworkSearchPaths.push_back("$(inherited)"); iPhone_FrameworkSearchPaths.push_back("\"$(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\""); @@ -856,6 +856,8 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { ADD_SETTING(iPhone_Release, "COPY_PHASE_STRIP", "YES"); REMOVE_SETTING(iPhone_Release, "GCC_DYNAMIC_NO_PIC"); ADD_SETTING(iPhone_Release, "WRAPPER_EXTENSION", "app"); + REMOVE_SETTING(iPhone_Release, "DEBUG_INFORMATION_FORMAT"); + ADD_SETTING_QUOTE(iPhone_Release, "DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym"); iPhone_Release_Object->addProperty("name", "Release", "", SettingsNoValue); iPhone_Release_Object->properties["buildSettings"] = iPhone_Release; @@ -874,7 +876,7 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { ADD_SETTING(scummvmOSX_Debug, "SDKROOT", "macosx"); ADD_SETTING(scummvmOSX_Debug, "COMPRESS_PNG_FILES", "NO"); ADD_SETTING(scummvmOSX_Debug, "COPY_PHASE_STRIP", "NO"); - ADD_SETTING_QUOTE(scummvmOSX_Debug, "DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym"); + ADD_SETTING_QUOTE(scummvmOSX_Debug, "DEBUG_INFORMATION_FORMAT", "dwarf"); ADD_SETTING_QUOTE(scummvmOSX_Debug, "FRAMEWORK_SEARCH_PATHS", ""); ADD_SETTING(scummvmOSX_Debug, "GCC_C_LANGUAGE_STANDARD", "c99"); ADD_SETTING(scummvmOSX_Debug, "GCC_ENABLE_CPP_EXCEPTIONS", "NO"); @@ -933,6 +935,8 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { REMOVE_SETTING(scummvmOSX_Release, "GCC_DYNAMIC_NO_PIC"); REMOVE_SETTING(scummvmOSX_Release, "GCC_OPTIMIZATION_LEVEL"); ADD_SETTING(scummvmOSX_Release, "WRAPPER_EXTENSION", "app"); + REMOVE_SETTING(scummvmOSX_Release, "DEBUG_INFORMATION_FORMAT"); + ADD_SETTING_QUOTE(scummvmOSX_Release, "DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym"); scummvmOSX_Release_Object->addProperty("name", "Release", "", SettingsNoValue); scummvmOSX_Release_Object->properties["buildSettings"] = scummvmOSX_Release; -- cgit v1.2.3 From ee73bb428f6f23b921e8c832778b0225618c35b8 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 9 Dec 2015 15:32:52 +0100 Subject: IOS: Compute MD5 identifiers instead of random To avoid recompiling the wole project each time we use the create_project tool. --- devtools/create_project/xcode.cpp | 25 +++++++++++++++++++++- devtools/create_project/xcode.h | 3 +++ .../xcode/create_project.xcodeproj/project.pbxproj | 19 ++++++++++------ 3 files changed, 39 insertions(+), 8 deletions(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index db91bb873d..1239974d11 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -26,6 +26,12 @@ #include #include +#ifdef MACOSX +#include +#include +#include +#endif + namespace CreateProjectTool { #define DEBUG_XCODE_HASH 0 @@ -1008,7 +1014,6 @@ void XcodeProvider::setupDefines(const BuildSetup &setup) { // Object hash ////////////////////////////////////////////////////////////////////////// -// TODO use md5 to compute a file hash (and fall back to standard key generation if not passed a file) std::string XcodeProvider::getHash(std::string key) { #if DEBUG_XCODE_HASH @@ -1020,7 +1025,12 @@ std::string XcodeProvider::getHash(std::string key) { return hashIterator->second; // Generate a new key from the file hash and insert it into the dictionary +#ifdef MACOSX + std::string hash = md5(key); +#else std::string hash = newHash(); +#endif + _hashDictionnary[key] = hash; return hash; @@ -1029,6 +1039,19 @@ std::string XcodeProvider::getHash(std::string key) { bool isSeparator (char s) { return (s == '-'); } +#ifdef MACOSX +std::string XcodeProvider::md5(std::string key) { + unsigned char md[CC_MD5_DIGEST_LENGTH]; + CC_MD5(key.c_str(), (CC_LONG) key.length(), md); + std::stringstream stream; + stream << std::hex << std::setfill('0') << std::setw(2); + for (int i=0; iproperties["children"] = children; _groups.add(frameworksGroup); @@ -495,11 +499,11 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) { frameworks_iOS.push_back("QuartzCore.framework"); frameworks_iOS.push_back("OpenGLES.framework"); - frameworks_iOS.push_back("libFLACiOS.a"); - frameworks_iOS.push_back("libFreetype2.a"); - frameworks_iOS.push_back("libogg.a"); - frameworks_iOS.push_back("libpng.a"); - frameworks_iOS.push_back("libvorbis.a"); + if (CONTAINS_DEFINE(setup.defines, "USE_FLAC")) frameworks_iOS.push_back("libFLACiOS.a"); + if (CONTAINS_DEFINE(setup.defines, "USE_FREETYPE2")) frameworks_iOS.push_back("libFreetype2.a"); + if (CONTAINS_DEFINE(setup.defines, "USE_PNG")) frameworks_iOS.push_back("libpng.a"); + if (CONTAINS_DEFINE(setup.defines, "USE_VORBIS")) { frameworks_iOS.push_back("libogg.a"); frameworks_iOS.push_back("libvorbis.a"); } + if (CONTAINS_DEFINE(setup.defines, "USE_MAD")) frameworks_iOS.push_back("libmad.a"); for (ValueList::iterator framework = frameworks_iOS.begin(); framework != frameworks_iOS.end(); framework++) { std::string id = "Frameworks_" + *framework + "_iphone"; -- cgit v1.2.3 From c99456ecff9ae645385ea5a8aa423d0115dce08e Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Fri, 11 Dec 2015 14:24:29 +0100 Subject: IOS: Brings support for FluidSynth --- devtools/create_project/create_project.cpp | 21 ++++++------- devtools/create_project/xcode.cpp | 47 +++++++++++++++++++++++------- 2 files changed, 47 insertions(+), 21 deletions(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp index 2faf39a340..65b7601a54 100644 --- a/devtools/create_project/create_project.cpp +++ b/devtools/create_project/create_project.cpp @@ -935,16 +935,17 @@ TokenList tokenize(const std::string &input, char separator) { namespace { const Feature s_features[] = { // Libraries - { "libz", "USE_ZLIB", "zlib", true, "zlib (compression) support" }, - { "mad", "USE_MAD", "libmad", true, "libmad (MP3) support" }, - { "vorbis", "USE_VORBIS", "libvorbisfile_static libvorbis_static libogg_static", true, "Ogg Vorbis support" }, - { "flac", "USE_FLAC", "libFLAC_static win_utf8_io_static", true, "FLAC support" }, - { "png", "USE_PNG", "libpng", true, "libpng support" }, - { "faad", "USE_FAAD", "libfaad", false, "AAC support" }, - { "mpeg2", "USE_MPEG2", "libmpeg2", false, "MPEG-2 support" }, - { "theora", "USE_THEORADEC", "libtheora_static", true, "Theora decoding support" }, - {"freetype", "USE_FREETYPE2", "freetype", true, "FreeType support" }, - { "jpeg", "USE_JPEG", "jpeg-static", true, "libjpeg support" }, + { "libz", "USE_ZLIB", "zlib", true, "zlib (compression) support" }, + { "mad", "USE_MAD", "libmad", true, "libmad (MP3) support" }, + { "vorbis", "USE_VORBIS", "libvorbisfile_static libvorbis_static libogg_static", true, "Ogg Vorbis support" }, + { "flac", "USE_FLAC", "libFLAC_static win_utf8_io_static", true, "FLAC support" }, + { "png", "USE_PNG", "libpng", true, "libpng support" }, + { "faad", "USE_FAAD", "libfaad", false, "AAC support" }, + { "mpeg2", "USE_MPEG2", "libmpeg2", false, "MPEG-2 support" }, + { "theora", "USE_THEORADEC", "libtheora_static", true, "Theora decoding support" }, + { "freetype", "USE_FREETYPE2", "freetype", true, "FreeType support" }, + { "jpeg", "USE_JPEG", "jpeg-static", true, "libjpeg support" }, + {"fluidsynth", "USE_FLUIDSYNTH", "libfluidsynth", true, "FluidSynth support" }, // Feature flags { "bink", "USE_BINK", "", true, "Bink video support" }, diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index a0521d041e..9fddf8af3f 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -401,6 +401,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_SYSTBD(lib) properties[lib".tbd"] = FileProperty("sourcecode.text-based-dylib-definition", lib".tbd", "usr/lib/" lib ".tbd", "SDKROOT"); \ + ADD_SETTING_ORDER_NOVALUE(children, getHash(lib".tbd"), lib".tbd", fwOrder++); + #define DEF_LOCALLIB_STATIC_PATH(path,lib,absolute) properties[lib".a"] = FileProperty("archive.ar", lib ".a", path, (absolute ? "\"\"" : "\"\"")); \ ADD_SETTING_ORDER_NOVALUE(children, getHash(lib".a"), lib".a", fwOrder++); @@ -432,6 +435,7 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) { DEF_SYSFRAMEWORK("Carbon"); DEF_SYSFRAMEWORK("Cocoa"); DEF_SYSFRAMEWORK("CoreAudio"); + DEF_SYSFRAMEWORK("CoreMIDI"); DEF_SYSFRAMEWORK("CoreGraphics"); DEF_SYSFRAMEWORK("CoreFoundation"); DEF_SYSFRAMEWORK("CoreMIDI"); @@ -441,6 +445,8 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) { DEF_SYSFRAMEWORK("QuartzCore"); DEF_SYSFRAMEWORK("QuickTime"); DEF_SYSFRAMEWORK("UIKit"); + DEF_SYSTBD("libiconv"); + // Optionals: DEF_SYSFRAMEWORK("OpenGL"); @@ -461,12 +467,14 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) { absoluteOutputDir = "lib"; #endif - DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libFLACiOS.a", "libFLACiOS", true); - DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libFreetype2.a", "libFreetype2", true); - DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libogg.a", "libogg", true); - DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libpng.a", "libpng", true); - DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libvorbis.a", "libvorbis", true); - DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libmad.a", "libmad", true); + DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libFLACiOS.a", "libFLACiOS", true); + DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libFreetype2.a", "libFreetype2", true); + DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libogg.a", "libogg", true); + DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libpng.a", "libpng", true); + DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libvorbis.a", "libvorbis", true); + DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libmad.a", "libmad", true); + DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libfluidsynth.a", "libfluidsynth", true); + DEF_LOCALLIB_STATIC_PATH(absoluteOutputDir + "/libglib.a", "libglib", true); frameworksGroup->properties["children"] = children; _groups.add(frameworksGroup); @@ -499,11 +507,28 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) { frameworks_iOS.push_back("QuartzCore.framework"); frameworks_iOS.push_back("OpenGLES.framework"); - if (CONTAINS_DEFINE(setup.defines, "USE_FLAC")) frameworks_iOS.push_back("libFLACiOS.a"); - if (CONTAINS_DEFINE(setup.defines, "USE_FREETYPE2")) frameworks_iOS.push_back("libFreetype2.a"); - if (CONTAINS_DEFINE(setup.defines, "USE_PNG")) frameworks_iOS.push_back("libpng.a"); - if (CONTAINS_DEFINE(setup.defines, "USE_VORBIS")) { frameworks_iOS.push_back("libogg.a"); frameworks_iOS.push_back("libvorbis.a"); } - if (CONTAINS_DEFINE(setup.defines, "USE_MAD")) frameworks_iOS.push_back("libmad.a"); + if (CONTAINS_DEFINE(setup.defines, "USE_FLAC")) { + frameworks_iOS.push_back("libFLACiOS.a"); + } + if (CONTAINS_DEFINE(setup.defines, "USE_FREETYPE2")) { + frameworks_iOS.push_back("libFreetype2.a"); + } + if (CONTAINS_DEFINE(setup.defines, "USE_PNG")) { + frameworks_iOS.push_back("libpng.a"); + } + if (CONTAINS_DEFINE(setup.defines, "USE_VORBIS")) { + frameworks_iOS.push_back("libogg.a"); + frameworks_iOS.push_back("libvorbis.a"); + } + if (CONTAINS_DEFINE(setup.defines, "USE_MAD")) { + frameworks_iOS.push_back("libmad.a"); + } + if (CONTAINS_DEFINE(setup.defines, "USE_FLUIDSYNTH")) { + frameworks_iOS.push_back("libfluidsynth.a"); + frameworks_iOS.push_back("libglib.a"); + frameworks_iOS.push_back("CoreMIDI.framework"); + frameworks_iOS.push_back("libiconv.tbd"); + } for (ValueList::iterator framework = frameworks_iOS.begin(); framework != frameworks_iOS.end(); framework++) { std::string id = "Frameworks_" + *framework + "_iphone"; -- cgit v1.2.3 From 4687ff6d6d2863cc95c8137543ecf9c39bc01723 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 6 Jan 2016 15:11:40 +0100 Subject: DEVTOOL: Cleanup --- devtools/create_project/xcode.cpp | 2 +- devtools/create_project/xcode.h | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 5a433f1dd0..a4fbbf1cb9 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -1126,7 +1126,7 @@ std::string XcodeProvider::writeProperty(const std::string &variable, Property & if (settings.size() > 1 || (prop._flags & kSettingsSingleItem)) output += (flags & kSettingsSingleItem ? " " : "\t\t\t\t"); - output += writeSetting((*setting).first, (*setting).second); + output += writeSetting(setting->first, setting->second); // The combination of SettingsAsList, and kSettingsSingleItem should use "," and not ";" (i.e children // in PBXGroup, so we special case that case here. diff --git a/devtools/create_project/xcode.h b/devtools/create_project/xcode.h index 698b02e651..ab9be96eb1 100644 --- a/devtools/create_project/xcode.h +++ b/devtools/create_project/xcode.h @@ -65,7 +65,7 @@ private: std::string _sourceTree; FileProperty(std::string fileType = "", std::string name = "", std::string path = "", std::string source = "") - : _fileEncoding(""), _lastKnownFileType(fileType), _fileName(name), _filePath(path), _sourceTree(source) { + : _fileEncoding(""), _lastKnownFileType(fileType), _fileName(name), _filePath(path), _sourceTree(source) { } }; @@ -152,7 +152,7 @@ private: struct Object { public: std::string _id; // Unique identifier for this object - std::string _name; // Name (may not be unique - for ex. configuration entries) + std::string _name; // Name (may not be unique - for ex. configuration entries) std::string _refType; // Type of object this references (if any) std::string _comment; // Main comment (empty for no comment) @@ -210,6 +210,7 @@ private: assert(!_properties["isa"]._settings.empty()); SettingList::iterator it = _properties["isa"]._settings.begin(); + return it->first; } }; @@ -233,8 +234,8 @@ private: } Object *find(std::string id) { - for (std::vector::iterator it = objects.begin(); it != objects.end(); ++it) { - if ((*it)->id == id) { + for (std::vector::iterator it = _objects.begin(); it != _objects.end(); ++it) { + if ((*it)->_id == id) { return *it; } } -- cgit v1.2.3 From cbde1ef953706a11c08fdacd034a64040d6e7ee9 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 6 Jan 2016 10:19:10 +0100 Subject: DEVTOOL: Adds a macro for the iOS 7 target --- devtools/create_project/xcode.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index a4fbbf1cb9..b92146ec7f 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -791,6 +791,7 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { REMOVE_DEFINE(scummvm_defines, "MACOSX"); REMOVE_DEFINE(scummvm_defines, "IPHONE"); REMOVE_DEFINE(scummvm_defines, "IPHONE_OFFICIAL"); + REMOVE_DEFINE(scummvm_defines, "IPHONE_OFFICIAL_IOS7"); REMOVE_DEFINE(scummvm_defines, "SDL_BACKEND"); ADD_SETTING_LIST(scummvm_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, kSettingsNoQuote | kSettingsAsList, 5); ADD_SETTING(scummvm_Debug, "GCC_THUMB_SUPPORT", "NO"); @@ -877,6 +878,7 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { ADD_DEFINE(scummvmIOS_defines, "\"$(inherited)\""); ADD_DEFINE(scummvmIOS_defines, "IPHONE"); ADD_DEFINE(scummvmIOS_defines, "IPHONE_OFFICIAL"); + ADD_DEFINE(scummvmIOS_defines, "IPHONE_OFFICIAL_IOS7"); ADD_SETTING_LIST(iPhone_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmIOS_defines, kSettingsNoQuote | kSettingsAsList, 5); ADD_SETTING(iPhone_Debug, "ASSETCATALOG_COMPILER_APPICON_NAME", "AppIcon"); ADD_SETTING(iPhone_Debug, "ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME", "LaunchImage"); @@ -1032,6 +1034,7 @@ void XcodeProvider::setupDefines(const BuildSetup &setup) { REMOVE_DEFINE(_defines, "MACOSX"); REMOVE_DEFINE(_defines, "IPHONE"); REMOVE_DEFINE(_defines, "IPHONE_OFFICIAL"); + REMOVE_DEFINE(_defines, "IPHONE_OFFICIAL_IOS7"); REMOVE_DEFINE(_defines, "SDL_BACKEND"); ADD_DEFINE(_defines, "CONFIG_H"); ADD_DEFINE(_defines, "UNIX"); -- cgit v1.2.3 From 4cea4904a1cab8d7fab5dccd554283b0ef97c6d3 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 6 Jan 2016 11:01:33 +0100 Subject: DEVTOOL: Formatting --- devtools/create_project/xcode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index b92146ec7f..13c113f214 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -154,7 +154,7 @@ XcodeProvider::Group::Group(XcodeProvider *objectParent, const std::string &grou bool path_is_absolute = (path.length() > 0 && path.at(0) == '/'); addProperty("name", _name, "", kSettingsNoValue | kSettingsQuoteVariable); addProperty("sourceTree", path_is_absolute ? "" : "", "", kSettingsNoValue | kSettingsQuoteVariable); - + if (path != "") { addProperty("path", path, "", kSettingsNoValue | kSettingsQuoteVariable); } -- cgit v1.2.3 From 56f6ac5f6e232e02e39e377e3bb31bf94181ec74 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 6 Jan 2016 11:37:51 +0100 Subject: DEVTOOL: Removes useless macro --- devtools/create_project/xcode.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 13c113f214..5c8b773e83 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -1038,7 +1038,6 @@ void XcodeProvider::setupDefines(const BuildSetup &setup) { REMOVE_DEFINE(_defines, "SDL_BACKEND"); ADD_DEFINE(_defines, "CONFIG_H"); ADD_DEFINE(_defines, "UNIX"); - ADD_DEFINE(_defines, "XCODE"); ADD_DEFINE(_defines, "SCUMMVM"); } -- cgit v1.2.3 From 40373d80a6d248e90eec7fe50c13b1a1f9041cc0 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 6 Jan 2016 11:38:42 +0100 Subject: DEVTOOL: Fixes a typo --- devtools/create_project/xcode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index 5c8b773e83..d4c23ea3bd 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -1130,7 +1130,7 @@ std::string XcodeProvider::writeProperty(const std::string &variable, Property & output += writeSetting(setting->first, setting->second); - // The combination of SettingsAsList, and kSettingsSingleItem should use "," and not ";" (i.e children + // The combination of kSettingsAsList, and kSettingsSingleItem should use "," and not ";" (i.e children // in PBXGroup, so we special case that case here. if ((prop._flags & kSettingsAsList) && (prop._settings.size() > 1 || (prop._flags & kSettingsSingleItem))) { output += (prop._settings.size() > 0) ? ",\n" : "\n"; -- cgit v1.2.3 From c7e65e60dd9bf8042a5eb5fd65d838c412b2e7b9 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 6 Jan 2016 11:39:53 +0100 Subject: DEVTOOL: Formatting --- devtools/create_project/xcode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.h b/devtools/create_project/xcode.h index ab9be96eb1..d495dd0dfd 100644 --- a/devtools/create_project/xcode.h +++ b/devtools/create_project/xcode.h @@ -152,7 +152,7 @@ private: struct Object { public: std::string _id; // Unique identifier for this object - std::string _name; // Name (may not be unique - for ex. configuration entries) + std::string _name; // Name (may not be unique - for ex. configuration entries) std::string _refType; // Type of object this references (if any) std::string _comment; // Main comment (empty for no comment) -- cgit v1.2.3 From a4f9b9e2ae4a6a228eed68423168336b990bbc61 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 6 Jan 2016 13:41:15 +0100 Subject: DEVTOOL: Fixes a typo in an unused macro --- devtools/create_project/xcode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index d4c23ea3bd..d2eec76741 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -52,7 +52,7 @@ namespace CreateProjectTool { config._settings[key] = Setting(value, "", kSettingsNoQuote); #define ADD_SETTING_ORDER(config, key, value, order) \ - config.settings[key] = Setting(value, "", SettingsNoQuote, 0, order); + config.settings[key] = Setting(value, "", kSettingsNoQuote, 0, order); #define ADD_SETTING_ORDER_NOVALUE(config, key, comment, order) \ config._settings[key] = Setting("", comment, kSettingsNoValue, 0, order); -- cgit v1.2.3 From b5ef98637c54a453a6f0ac0ca8c501ceb59924d5 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Thu, 7 Jan 2016 09:51:13 +0100 Subject: IOS: Renames a macro --- devtools/create_project/xcode.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'devtools/create_project') diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp index d2eec76741..8274875ec5 100644 --- a/devtools/create_project/xcode.cpp +++ b/devtools/create_project/xcode.cpp @@ -790,8 +790,8 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { ValueList scummvm_defines(_defines); REMOVE_DEFINE(scummvm_defines, "MACOSX"); REMOVE_DEFINE(scummvm_defines, "IPHONE"); - REMOVE_DEFINE(scummvm_defines, "IPHONE_OFFICIAL"); - REMOVE_DEFINE(scummvm_defines, "IPHONE_OFFICIAL_IOS7"); + REMOVE_DEFINE(scummvm_defines, "IPHONE_IOS7"); + REMOVE_DEFINE(scummvm_defines, "IPHONE_SANDBOXED"); REMOVE_DEFINE(scummvm_defines, "SDL_BACKEND"); ADD_SETTING_LIST(scummvm_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, kSettingsNoQuote | kSettingsAsList, 5); ADD_SETTING(scummvm_Debug, "GCC_THUMB_SUPPORT", "NO"); @@ -877,8 +877,8 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) { ValueList scummvmIOS_defines; ADD_DEFINE(scummvmIOS_defines, "\"$(inherited)\""); ADD_DEFINE(scummvmIOS_defines, "IPHONE"); - ADD_DEFINE(scummvmIOS_defines, "IPHONE_OFFICIAL"); - ADD_DEFINE(scummvmIOS_defines, "IPHONE_OFFICIAL_IOS7"); + ADD_DEFINE(scummvmIOS_defines, "IPHONE_IOS7"); + ADD_DEFINE(scummvmIOS_defines, "IPHONE_SANDBOXED"); ADD_SETTING_LIST(iPhone_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmIOS_defines, kSettingsNoQuote | kSettingsAsList, 5); ADD_SETTING(iPhone_Debug, "ASSETCATALOG_COMPILER_APPICON_NAME", "AppIcon"); ADD_SETTING(iPhone_Debug, "ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME", "LaunchImage"); @@ -1033,8 +1033,8 @@ void XcodeProvider::setupDefines(const BuildSetup &setup) { // Add special defines for Mac support REMOVE_DEFINE(_defines, "MACOSX"); REMOVE_DEFINE(_defines, "IPHONE"); - REMOVE_DEFINE(_defines, "IPHONE_OFFICIAL"); - REMOVE_DEFINE(_defines, "IPHONE_OFFICIAL_IOS7"); + REMOVE_DEFINE(_defines, "IPHONE_IOS7"); + REMOVE_DEFINE(_defines, "IPHONE_SANDBOXED"); REMOVE_DEFINE(_defines, "SDL_BACKEND"); ADD_DEFINE(_defines, "CONFIG_H"); ADD_DEFINE(_defines, "UNIX"); -- cgit v1.2.3