view generator/global.h @ 390:403d98bd47f6

Added QT_{BEGIN,END}_{HEADER,NAMESPACE} also to the D2 version ? they are empty, but referenced in the output of duic.
author David Nadlinger <code@klickverbot.at>
date Fri, 27 Aug 2010 15:05:23 +0200
parents e700fa4916e4
children
line wrap: on
line source

#ifndef GLOBAL_H
#define GLOBAL_H

#include <QString>

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