diff options
Diffstat (limited to 'devtools/create_project/create_project.h')
-rw-r--r-- | devtools/create_project/create_project.h | 72 |
1 files changed, 65 insertions, 7 deletions
diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h index de77793ee7..459342a67d 100644 --- a/devtools/create_project/create_project.h +++ b/devtools/create_project/create_project.h @@ -23,6 +23,10 @@ #ifndef TOOLS_CREATE_PROJECT_H #define TOOLS_CREATE_PROJECT_H +#ifndef __has_feature // Optional of course. + #define __has_feature(x) 0 // Compatibility with non-clang compilers. +#endif + #include <map> #include <list> #include <string> @@ -98,16 +102,17 @@ struct EngineDesc { typedef std::list<EngineDesc> EngineDescList; /** - * This function parses the project configure file and creates a list - * of available engines. + * This function parses the project directory and creates a list of + * available engines. * * It will also automatically setup the default build state (enabled - * or disabled) to the state specified in the "configure" file. + * or disabled) to the state specified in the individual configure.engine + * files. * * @param srcDir Path to the root of the project source. * @return List of available engines. */ -EngineDescList parseConfigure(const std::string &srcDir); +EngineDescList parseEngines(const std::string &srcDir); /** * Checks whether the specified engine is a sub engine. To determine this @@ -221,13 +226,16 @@ struct BuildSetup { StringList defines; ///< List of all defines for the build. StringList libraries; ///< List of all external libraries required for the build. + StringList testDirs; ///< List of all folders containing tests bool devTools; ///< Generate project files for the tools + bool tests; ///< Generate project files for the tests bool runBuildEvents; ///< Run build events as part of the build (generate revision number and copy engine/theme data & needed files to the build folder bool createInstaller; ///< Create NSIS installer after the build BuildSetup() { devTools = false; + tests = false; runBuildEvents = false; createInstaller = false; } @@ -256,6 +264,22 @@ void NORETURN_PRE error(const std::string &message) NORETURN_POST; namespace CreateProjectTool { /** + * Structure for describing an FSNode. This is a very minimalistic + * description, which includes everything we need. + * It only contains the name of the node and whether it is a directory + * or not. + */ +struct FSNode { + FSNode() : name(), isDirectory(false) {} + FSNode(const std::string &n, bool iD) : name(n), isDirectory(iD) {} + + std::string name; ///< Name of the file system node + bool isDirectory; ///< Whether it is a directory or not +}; + +typedef std::list<FSNode> FileList; + +/** * Gets a proper sequence of \t characters for the given * indentation level. * @@ -300,6 +324,30 @@ void splitFilename(const std::string &fileName, std::string &name, std::string & bool producesObjectFile(const std::string &fileName); /** +* Convert an integer to string +* +* @param num the integer to convert +* @return string representation of the number +*/ +std::string toString(int num); + +/** + * Returns a list of all files and directories in the specified + * path. + * + * @param dir Directory which should be listed. + * @return List of all children. + */ +FileList listDirectory(const std::string &dir); + +/** + * Create a directory at the given path. + * + * @param dir The path to create. + */ +void createDirectory(const std::string &dir); + +/** * Structure representing a file tree. This contains two * members: name and children. "name" holds the name of * the node. "children" does contain all the node's children. @@ -339,7 +387,7 @@ public: * * @param setup Description of the desired build setup. */ - void createProject(const BuildSetup &setup); + void createProject(BuildSetup &setup); /** * Returns the last path component. @@ -430,10 +478,11 @@ protected: * * @param moduleDir Path to the module. * @param defines List of set defines. + * @param testDirs List of folders containing tests. * @param includeList Reference to a list, where included files should be added. * @param excludeList Reference to a list, where excluded files should be added. */ - void createModuleList(const std::string &moduleDir, const StringList &defines, StringList &includeList, StringList &excludeList) const; + void createModuleList(const std::string &moduleDir, const StringList &defines, StringList &testDirs, StringList &includeList, StringList &excludeList) const; /** * Creates an UUID for every enabled engine of the @@ -448,7 +497,7 @@ protected: * Creates an UUID for every enabled tool of the * passed build description. * - * @return A map, which includes UUIDs for all enabled engines. + * @return A map, which includes UUIDs for all enabled tools. */ UUIDMap createToolsUUIDMap() const; @@ -458,6 +507,15 @@ protected: * @return A new UUID as string. */ std::string createUUID() const; + +private: + /** + * This creates the engines/plugins_table.h file required for building + * ScummVM. + * + * @param setup Description of the desired build. + */ + void createEnginePluginsTable(const BuildSetup &setup); }; } // End of CreateProjectTool namespace |