diff options
author | Einar Johan Trøan Sømåen | 2015-04-04 18:17:10 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2015-04-09 20:02:15 +0200 |
commit | 9ef6e598058179e5124a75963d25e7e0936c29c4 (patch) | |
tree | 43ee5831448802ff4879d754d85c6bae54067976 | |
parent | d6625c20bfa27a3745b78956adbe47d20c3ff0ad (diff) | |
download | scummvm-rg350-9ef6e598058179e5124a75963d25e7e0936c29c4.tar.gz scummvm-rg350-9ef6e598058179e5124a75963d25e7e0936c29c4.tar.bz2 scummvm-rg350-9ef6e598058179e5124a75963d25e7e0936c29c4.zip |
CREATE_PROJECT: Make ProjectProvider able to work properly with subclasses that want to create one single project.
-rw-r--r-- | devtools/create_project/create_project.cpp | 20 | ||||
-rw-r--r-- | devtools/create_project/create_project.h | 7 | ||||
-rw-r--r-- | devtools/create_project/xcode.h | 3 |
3 files changed, 22 insertions, 8 deletions
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp index 34d30e1d69..ffaa4274f4 100644 --- a/devtools/create_project/create_project.cpp +++ b/devtools/create_project/create_project.cpp @@ -1279,18 +1279,23 @@ void ProjectProvider::createProject(BuildSetup &setup) { for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) { if (i->first == setup.projectName) continue; - - in.clear(); ex.clear(); + // Retain the files between engines if we're creating a single project + if (createOneProjectPerEngine()) { + in.clear(); ex.clear(); + } const std::string moduleDir = setup.srcDir + targetFolder + i->first; createModuleList(moduleDir, setup.defines, setup.testDirs, in, ex); - createProjectFile(i->first, i->second, setup, moduleDir, in, ex); + if (createOneProjectPerEngine()) { + createProjectFile(i->first, i->second, setup, moduleDir, in, ex); + } } if (setup.tests) { // Create the main project file. - in.clear(); ex.clear(); - + if (createOneProjectPerEngine()) { + in.clear(); ex.clear(); + } createModuleList(setup.srcDir + "/backends", setup.defines, setup.testDirs, in, ex); createModuleList(setup.srcDir + "/backends/platform/sdl", setup.defines, setup.testDirs, in, ex); createModuleList(setup.srcDir + "/base", setup.defines, setup.testDirs, in, ex); @@ -1304,8 +1309,9 @@ void ProjectProvider::createProject(BuildSetup &setup) { createProjectFile(setup.projectName, svmUUID, setup, setup.srcDir, in, ex); } else if (!setup.devTools) { // Last but not least create the main project file. - in.clear(); ex.clear(); - + if (createOneProjectPerEngine()) { + in.clear(); ex.clear(); + } // File list for the Project file createModuleList(setup.srcDir + "/backends", setup.defines, setup.testDirs, in, ex); createModuleList(setup.srcDir + "/backends/platform/sdl", setup.defines, setup.testDirs, in, ex); diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h index 459342a67d..cea1222b4d 100644 --- a/devtools/create_project/create_project.h +++ b/devtools/create_project/create_project.h @@ -459,6 +459,13 @@ protected: virtual const char *getProjectExtension() { return ""; } /** + * Returns whether the provider produces one project per engine + * allowing providers such as the XCode-project provider to disable + * the logic for this in the super-class, thus merging the engine-files + * into the main project instead. + */ + virtual bool createOneProjectPerEngine() const { return true; } + /** * Adds files of the specified directory recursively to given project file. * * @param dir Path to the directory. diff --git a/devtools/create_project/xcode.h b/devtools/create_project/xcode.h index f86e7c555c..f7714e4dba 100644 --- a/devtools/create_project/xcode.h +++ b/devtools/create_project/xcode.h @@ -45,7 +45,8 @@ protected: void writeFileListToProject(const FileNode &dir, std::ofstream &projectFile, const int indentation, const StringList &duplicate, const std::string &objPrefix, const std::string &filePrefix); - + // Disable multi-project creation on ProjectProvider + bool createOneProjectPerEngine() const { return false; } private: enum { SettingsAsList = 0x01, |