Game Develop C++ Platform: FullProjectCompiler.h Source File

| Game Develop C++ Platform Platform for developing native games based on OpenGL and SFML with Game Develop

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
FullProjectCompiler.h
Go to the documentation of this file.
1
6 #if defined(GD_IDE_ONLY)
7 #ifndef FULLPROJECTCOMPILER_H
8 #define FULLPROJECTCOMPILER_H
9 #include <string>
10 namespace gd { class Project; }
11
12 namespace GDpriv
13 {
14
15 class FullProjectCompilerDiagnosticManager; //Definition below
16
20 class GD_API FullProjectCompiler
21 {
22 public:
23 FullProjectCompiler(gd::Project & game_, FullProjectCompilerDiagnosticManager & diagnosticManager_, std::string outDir_) :
24 gameToCompile(game_),
25 diagnosticManager(diagnosticManager_),
26 outDir(outDir_),
27 windowsTarget(false),
28 linuxTarget(false),
29 macTarget(false)
30 {};
31 virtual ~FullProjectCompiler() {};
32
33 void LaunchProjectCompilation();
34
35 void ClearDirectory(std::string directory);
36 std::string GetTempDir();
37 void SetForcedTempDir(const std::string & dir) { forcedTempDir = dir; };
38
39 //Cross compilation is not available
40 /*void TargetWindows(bool enable = true) { windowsTarget = enable; };
41 void TargetLinux(bool enable = true) { linuxTarget = enable; };
42 void TargetMac(bool enable = true) { macTarget = enable; };*/
43 void CompressIfPossible(bool enable = true) { compressIfPossible = enable; };
44 void Optimize(bool enable = true) { optimize = enable; };
45
46 private:
47
48 gd::Project & gameToCompile;
49 FullProjectCompilerDiagnosticManager & diagnosticManager;
50 std::string outDir;
51 std::string forcedTempDir;
52
53 bool windowsTarget;
54 bool linuxTarget;
55 bool macTarget;
56 bool compressIfPossible;
57 bool optimize;
58 };
59
64 class GD_API FullProjectCompilerDiagnosticManager
65 {
66 public:
67 virtual void OnCompilationFailed() {};
68 virtual void OnCompilationSuccessed() {};
69 virtual void OnMessage(std::string message, std::string message2 = "") {};
70 virtual void OnPercentUpdate(float percents) {};
71
72 std::string GetErrors() const { return errors; }
73 void AddError(std::string error) { errors += error+"\n"; };
74
75 private:
76 std::string errors;
77 };
78
82 class GD_API FullProjectCompilerConsoleDiagnosticManager : public FullProjectCompilerDiagnosticManager
83 {
84 public:
85 virtual void OnCompilationFailed();
86 virtual void OnCompilationSuccessed();
87 virtual void OnMessage(std::string message, std::string message2 = "");
88 virtual void OnPercentUpdate(float percents);
89 };
90
91
92 }
93
94 #endif // FULLPROJECTCOMPILER_H
95 #endif
96