diff options
Diffstat (limited to 'qbs')
-rw-r--r-- | qbs/imports/QtcFunctions/functions.js (renamed from qbs/functions.js) | 0 | ||||
-rw-r--r-- | qbs/imports/QtcLibrary.qbs | 38 | ||||
-rw-r--r-- | qbs/imports/QtcPlugin.qbs | 62 | ||||
-rw-r--r-- | qbs/imports/QtcTool.qbs | 19 | ||||
-rw-r--r-- | qbs/modules/pluginspec/pluginspec.qbs (renamed from qbs/pluginspec/pluginspec.qbs) | 0 |
5 files changed, 119 insertions, 0 deletions
diff --git a/qbs/functions.js b/qbs/imports/QtcFunctions/functions.js index 23a51f80e8..23a51f80e8 100644 --- a/qbs/functions.js +++ b/qbs/imports/QtcFunctions/functions.js diff --git a/qbs/imports/QtcLibrary.qbs b/qbs/imports/QtcLibrary.qbs new file mode 100644 index 0000000000..f7272066fb --- /dev/null +++ b/qbs/imports/QtcLibrary.qbs @@ -0,0 +1,38 @@ +import qbs.base 1.0 +import QtcFunctions + +DynamicLibrary { + Depends { name: "cpp" } + Depends { + condition: project.testsEnabled + name: "Qt.test" + } + + targetName: QtcFunctions.qtLibraryName(qbs, name) + destinationDirectory: project.ide_library_path + + cpp.defines: project.generalDefines + cpp.linkerFlags: { + if (qbs.buildVariant == "release" && (qbs.toolchain.contains("gcc") || qbs.toolchain.contains("mingw"))) + return ["-Wl,-s"] + else if (qbs.buildVariant == "debug" && qbs.toolchain.contains("msvc")) + return ["/INCREMENTAL:NO"] // Speed up startup time when debugging with cdb + } + cpp.installNamePrefix: "@rpath/PlugIns/" + cpp.rpaths: qbs.targetOS.contains("osx") + ? ["@loader_path/..", "@executable_path/.."] + : ["$ORIGIN", "$ORIGIN/.."] + property string libIncludeBase: ".." // #include <lib/header.h> + cpp.includePaths: [libIncludeBase] + + Export { + Depends { name: "cpp" } + cpp.includePaths: [libIncludeBase] + } + + Group { + fileTagsFilter: product.type + qbs.install: true + qbs.installDir: project.ide_library_path + } +} diff --git a/qbs/imports/QtcPlugin.qbs b/qbs/imports/QtcPlugin.qbs new file mode 100644 index 0000000000..624d8bab7e --- /dev/null +++ b/qbs/imports/QtcPlugin.qbs @@ -0,0 +1,62 @@ +import qbs.base 1.0 +import qbs.FileInfo +import QtcFunctions + +Product { + type: ["dynamiclibrary", "pluginSpec"] + property string provider: 'QtProject' + property var pluginspecreplacements + property var pluginRecommends: [] + + Depends { name: "Qt.core" } + property string minimumQtVersion: "4.8" + condition: QtcFunctions.versionIsAtLeast(Qt.core.version, minimumQtVersion) + + targetName: QtcFunctions.qtLibraryName(qbs, name) + destinationDirectory: project.ide_plugin_path + '/' + provider + + Depends { name: "ExtensionSystem" } + Depends { name: "pluginspec" } + Depends { name: "cpp" } + Depends { + condition: project.testsEnabled + name: "Qt.test" + } + + cpp.defines: project.generalDefines.concat([name.toUpperCase() + "_LIBRARY"]) + cpp.installNamePrefix: "@rpath/PlugIns/" + provider + "/" + cpp.rpaths: qbs.targetOS.contains("osx") ? ["@loader_path/../..", "@executable_path/.."] + : ["$ORIGIN", "$ORIGIN/..", "$ORIGIN/../.."] + cpp.linkerFlags: { + if (qbs.buildVariant == "release" && (qbs.toolchain.contains("gcc") || qbs.toolchain.contains("mingw"))) + return ["-Wl,-s"] + else if (qbs.buildVariant == "debug" && qbs.toolchain.contains("msvc")) + return ["/INCREMENTAL:NO"] // Speed up startup time when debugging with cdb + } + + property string pluginIncludeBase: ".." // #include <plugin/header.h> + cpp.includePaths: [pluginIncludeBase] + + Group { + name: "PluginSpec" + files: [ product.name + ".pluginspec.in" ] + fileTags: ["pluginSpecIn"] + } + + Group { + name: "MimeTypes" + files: [ "*.mimetypes.xml" ] + } + + Group { + fileTagsFilter: product.type + qbs.install: true + qbs.installDir: project.ide_plugin_path + "/" + provider + } + + Export { + Depends { name: "ExtensionSystem" } + Depends { name: "cpp" } + cpp.includePaths: [pluginIncludeBase] + } +} diff --git a/qbs/imports/QtcTool.qbs b/qbs/imports/QtcTool.qbs new file mode 100644 index 0000000000..5494d0dc5d --- /dev/null +++ b/qbs/imports/QtcTool.qbs @@ -0,0 +1,19 @@ +import qbs.base 1.0 + +Application { + type: "application" // no Mac app bundle + Depends { name: "cpp" } + cpp.defines: project.generalDefines + cpp.linkerFlags: { + if (qbs.buildVariant == "release" && (qbs.toolchain.contains("gcc") || qbs.toolchain.contains("mingw"))) + return ["-Wl,-s"] + } + + property string toolInstallDir: project.ide_libexec_path + + Group { + fileTagsFilter: product.type + qbs.install: true + qbs.installDir: toolInstallDir + } +} diff --git a/qbs/pluginspec/pluginspec.qbs b/qbs/modules/pluginspec/pluginspec.qbs index ca8fdae8f4..ca8fdae8f4 100644 --- a/qbs/pluginspec/pluginspec.qbs +++ b/qbs/modules/pluginspec/pluginspec.qbs |