# HG changeset patch # User Max Samukha # Date 1279300274 -10800 # Node ID e700fa4916e4cb8f6a578ab1ea3b885438ab045c # Parent d2f48c4cb3e38d13e79214f3c3db9ae0f382b7e4 Added missing files diff -r d2f48c4cb3e3 -r e700fa4916e4 generator/global.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/generator/global.cpp Fri Jul 16 20:11:14 2010 +0300 @@ -0,0 +1,7 @@ +#include "global.h" + +Global global; + +Global::Global() +{ +} diff -r d2f48c4cb3e3 -r e700fa4916e4 generator/global.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/generator/global.h Fri Jul 16 20:11:14 2010 +0300 @@ -0,0 +1,45 @@ +#ifndef GLOBAL_H +#define GLOBAL_H + +#include + +class Global +{ +public: + enum TargetPlatform + { + UnixTarget, + Win32Target + }; + + TargetPlatform targetPlatform; + bool cppShared; + bool dPhobos; + int dVersion; + + + void setTargetPlatform(QString tp) + { + if (tp == "win32") + targetPlatform = Win32Target; + else if (tp == "unix") + targetPlatform = UnixTarget; + + else if (tp.isEmpty()) { +#if WIN32 + targetPlatform = Win32Target; +#else + targetPlatform = UnixTarget; +#endif + } + else + qFatal("Target platform %s is not supported", qPrintable(tp)); + } + + Global(); + +}; + +extern Global global; + +#endif // GLOBAL_H