aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/qtprofilesetup/templates/qtfunctions.js
blob: 144955d5e3d0e9029085f1b7790d5a2c874d49b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// helper functions for the Qt modules

function getPlatformLibraryName(name, qtcore, qbs)
{
    var libName = name;
    if (qbs.targetOS.contains('windows')) {
        libName += (qbs.enableDebugCode ? 'd' : '');
        if (qtcore.versionMajor < 5)
            libName += qtcore.versionMajor;
        if (!qbs.toolchain.contains("mingw"))
            libName += '.lib';
    }
    if (qbs.targetOS.contains("darwin")) {
        if (!qtcore.frameworkBuild && qtcore.buildVariant.contains("debug") &&
                (!qtcore.buildVariant.contains("release") || qbs.enableDebugCode))
            libName += '_debug';
    }
    return libName;
}

function getQtLibraryName(qtModule, qtcore, qbs, prefix)
{
    var libName = (prefix === undefined) ? "Qt" : prefix;
    if (qtcore.versionMajor >= 5 && !qtcore.frameworkBuild)
        libName += qtcore.versionMajor;
    libName += qtModule;
    return getPlatformLibraryName(libName, qtcore, qbs);
}