aboutsummaryrefslogtreecommitdiffstats
path: root/qbs/imports/QtcPlugin.qbs
blob: 4fc7917c4193384c8433ad46fd93d0fb4f3dc4d2 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
import qbs 1.0
import qbs.FileInfo
import QtcFunctions

QtcProduct {
    type: ["dynamiclibrary", "pluginSpec", "qtc.dev-module"]
    installDir: qtc.ide_plugin_path
    installTags: ["dynamiclibrary", "debuginfo_dll"]
    useGuiPchFile: true

    property var pluginJsonReplacements
    property var pluginRecommends: []
    property var pluginTestDepends: []

    targetName: QtcFunctions.qtLibraryName(qbs, name)
    destinationDirectory: FileInfo.joinPaths(project.buildDirectory, qtc.ide_plugin_path)

    Depends { name: "ExtensionSystem" }
    Depends { name: "pluginjson" }
    pluginjson.useVcsData: false
    Depends {
        condition: qtc.testsEnabled
        name: "Qt.testlib"
    }

    Properties {
        condition: qbs.targetOS.contains("unix")
        cpp.internalVersion: ""
    }
    cpp.defines: base.concat([name.toUpperCase() + "_LIBRARY"])
    cpp.sonamePrefix: qbs.targetOS.contains("macos")
        ? "@rpath"
        : undefined
    cpp.rpaths: qbs.targetOS.contains("macos")
        ? ["@loader_path/../Frameworks", "@loader_path/../PlugIns"]
        : ["$ORIGIN", "$ORIGIN/.."]
    cpp.linkerFlags: {
        var flags = base;
        if (qbs.buildVariant == "debug" && qbs.toolchain.contains("msvc"))
            flags.push("/INCREMENTAL:NO"); // Speed up startup time when debugging with cdb
        if (qbs.targetOS.contains("macos"))
            flags.push("-compatibility_version", qtc.qtcreator_compat_version);
        return flags;
    }

    property string pluginIncludeBase: ".." // #include <plugin/header.h>
    cpp.includePaths: [pluginIncludeBase]

    Group {
        name: "PluginMetaData"
        prefix: product.sourceDirectory + '/'
        files: [ product.name + ".json.in" ]
        fileTags: ["pluginJsonIn"]
    }

    Export {
        Depends { name: "ExtensionSystem" }
        Depends { name: "cpp" }
        cpp.includePaths: [product.pluginIncludeBase]
    }
}