winscwtoolchain.cpp 2.79 KB
Newer Older
1
2
3
4
5
#include "winscwtoolchain.h"

using namespace ProjectExplorer;
using namespace Qt4ProjectManager::Internal;

con's avatar
con committed
6
7
WINSCWToolChain::WINSCWToolChain(S60Devices::Device device, const QString &mwcDirectory)
    : m_carbidePath(mwcDirectory),
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
    m_deviceId(device.id),
    m_deviceName(device.name),
    m_deviceRoot(device.epocRoot)
{

}

ToolChain::ToolChainType WINSCWToolChain::type() const
{
    return ToolChain::WINSCW;
}

QByteArray WINSCWToolChain::predefinedMacros()
{
    // TODO
    return m_predefinedMacros;
}

QList<HeaderPath> WINSCWToolChain::systemHeaderPaths()
{
con's avatar
con committed
28
29
30
31
32
    if (m_systemHeaderPaths.isEmpty()) {
        foreach (const QString &value, systemIncludes()) {
            m_systemHeaderPaths.append(HeaderPath(value, HeaderPath::GlobalHeaderPath));
        }
    }
33
34
35
    return m_systemHeaderPaths;
}

con's avatar
con committed
36
QStringList WINSCWToolChain::systemIncludes() const
37
38
39
40
41
42
43
44
45
46
47
{
    QStringList symIncludes = QStringList()
        << "\\MSL\\MSL_C\\MSL_Common\\Include"
        << "\\MSL\\MSL_C\\MSL_Win32\\Include"
        << "\\MSL\\MSL_CMSL_X86"
        << "\\MSL\\MSL_C++\\MSL_Common\\Include"
        << "\\MSL\\MSL_Extras\\MSL_Common\\Include"
        << "\\MSL\\MSL_Extras\\MSL_Win32\\Include"
        << "\\Win32-x86 Support\\Headers\\Win32 SDK";
    for (int i = 0; i < symIncludes.size(); ++i)
        symIncludes[i].prepend(QString("%1\\x86Build\\Symbian_Support").arg(m_carbidePath));
con's avatar
con committed
48
49
50
51
52
53
    return symIncludes;
}

void WINSCWToolChain::addToEnvironment(ProjectExplorer::Environment &env)
{
    env.set("MWCSYM2INCLUDES", systemIncludes().join(";"));
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
    QStringList symLibraries = QStringList()
        << "\\Win32-x86 Support\\Libraries\\Win32 SDK"
        << "\\Runtime\\Runtime_x86\\Runtime_Win32\\Libs";
    for (int i = 0; i < symLibraries.size(); ++i)
        symLibraries[i].prepend(QString("%1\\x86Build\\Symbian_Support").arg(m_carbidePath));
    env.set("MWSYM2LIBRARIES", symLibraries.join(";"));
    env.set("MWSYM2LIBRARYFILES", "MSL_All_MSE_Symbian_D.lib;gdi32.lib;user32.lib;kernel32.lib");
    env.prependOrSetPath(QString("%1\\x86Build\\Symbian_Tools\\Command_Line_Tools").arg(m_carbidePath)); // compiler
    env.prependOrSetPath(QString("%1\\epoc32\\tools").arg(m_deviceRoot)); // e.g. make.exe
    env.prependOrSetPath(QString("%1\\epoc32\\gcc\\bin").arg(m_deviceRoot)); // e.g. gcc.exe
    env.set("EPOCDEVICE", QString("%1:%2").arg(m_deviceId, m_deviceName));
    env.set("EPOCROOT", S60Devices::cleanedRootPath(m_deviceRoot));
}

QString WINSCWToolChain::makeCommand() const
{
    return "make";
}

73
QString WINSCWToolChain::defaultMakeTarget() const
con's avatar
con committed
74
75
76
77
{
    return "debug-winscw";
}

78
79
bool WINSCWToolChain::equals(ToolChain *other) const
{
con's avatar
con committed
80
81
    return (other->type() == type()
            && m_deviceId == static_cast<WINSCWToolChain *>(other)->m_deviceId
82
83
            && m_deviceName == static_cast<WINSCWToolChain *>(other)->m_deviceName);
}