aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qbsplugin.qbs
blob: b4721198f5d195d973869856242b74d8f6d74906 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import qbs.FileInfo

QbsProduct {
    property bool isForDarwin: qbs.targetOS.contains("darwin")
    property bool staticBuild: Qt.core.staticBuild || qbsbuildconfig.staticBuild
    Depends { name: "cpp" }
    Depends { name: "bundle"; condition: isForDarwin }
    Depends { name: "Qt.core" }
    Depends { name: "qbsbuildconfig" }
    Depends { name: "qbscore"; condition: !staticBuild }
    type: (staticBuild ? ["staticlibrary"] : [isForDarwin ? "loadablemodule" : "dynamiclibrary"])
        .concat(["qbsplugin"])
    Properties {
        condition: staticBuild
        cpp.defines: ["QBS_STATIC_LIB"]
    }
    cpp.includePaths: base.concat(["../../../lib/corelib"])
    cpp.visibility: "minimal"
    Group {
        fileTagsFilter: [isForDarwin ? "loadablemodule" : "dynamiclibrary"]
            .concat(qbs.buildVariant === "debug"
        ? [isForDarwin ? "debuginfo_loadablemodule" : "debuginfo_dll"] : [])
        qbs.install: true
        qbs.installDir: targetInstallDir
        qbs.installSourceBase: buildDirectory
    }
    targetInstallDir: qbsbuildconfig.pluginsInstallDir
    Properties {
        condition: isForDarwin
        bundle.isBundle: false
    }

    Export {
        Depends { name: "cpp" }
        Properties {
            condition: qbs.targetOS.contains("darwin")
            cpp.linkerFlags: ["-u", "_qbs_static_plugin_register_" + name]
        }
        Properties {
            condition: qbs.toolchain.contains("gcc")
            cpp.linkerFlags: "--require-defined=qbs_static_plugin_register_" + name
        }
        Properties {
            condition: qbs.toolchain.contains("msvc")
            cpp.linkerFlags: "/INCLUDE:qbs_static_plugin_register_" + name
        }
    }
}