aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qbsplugin.qbs
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2017-11-28 01:41:10 -0800
committerJake Petroules <jake.petroules@qt.io>2017-11-28 19:08:36 +0000
commit69a9ff441c5e5caa621d575358e5389702ff43f2 (patch)
tree5015cc41e70b515e90092ed2f323794c960da697 /src/plugins/qbsplugin.qbs
parent016e9da90906d0733a524f7241c8f94e842237c9 (diff)
Build plugins as MH_BUNDLEs on macOS
This is the native object format intended to be used for runtime loadable executable content (also known as "plugins"). Unlike most Unix systems, macOS's Mach-O executable format does differentiate between shared libraries (MH_DYLIB) and loadable modules (MH_BUNDLE). For the most part, the only noticeable difference is that attempting to link to an MH_BUNDLE will produce a hard error, which is in any case, helpful. Change-Id: I0d3ff284b3fe8f1b10700f1e48bc84dd5c4715b2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/qbsplugin.qbs')
-rw-r--r--src/plugins/qbsplugin.qbs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/plugins/qbsplugin.qbs b/src/plugins/qbsplugin.qbs
index 3a086966b..bc0ba3b81 100644
--- a/src/plugins/qbsplugin.qbs
+++ b/src/plugins/qbsplugin.qbs
@@ -2,12 +2,15 @@ import qbs
import qbs.FileInfo
QbsProduct {
+ property bool isForDarwin: qbs.targetOS.contains("darwin")
Depends { name: "cpp" }
- Depends { name: "bundle"; condition: qbs.targetOS.contains("darwin") }
+ Depends { name: "bundle"; condition: isForDarwin }
Depends { name: "Qt.core" }
Depends { name: "qbsbuildconfig" }
Depends { name: "qbscore"; condition: !Qt.core.staticBuild }
- type: (Qt.core.staticBuild ? ["staticlibrary"] : ["dynamiclibrary"]).concat(["qbsplugin"])
+ type: (Qt.core.staticBuild ? ["staticlibrary"]
+ : [isForDarwin ? "loadablemodule" : "dynamiclibrary"])
+ .concat(["qbsplugin"])
Properties {
condition: Qt.core.staticBuild
cpp.defines: ["QBS_STATIC_LIB"]
@@ -18,14 +21,15 @@ QbsProduct {
destinationDirectory: FileInfo.joinPaths(project.buildDirectory,
qbsbuildconfig.libDirName + "/qbs/plugins")
Group {
- fileTagsFilter: ["dynamiclibrary"]
- .concat(qbs.buildVariant === "debug" ? ["debuginfo_dll"] : [])
+ fileTagsFilter: [isForDarwin ? "loadablemodule" : "dynamiclibrary"]
+ .concat(qbs.buildVariant === "debug"
+ ? [isForDarwin ? "debuginfo_loadablemodule" : "debuginfo_dll"] : [])
qbs.install: true
qbs.installDir: qbsbuildconfig.pluginsInstallDir + "/qbs/plugins"
qbs.installSourceBase: destinationDirectory
}
Properties {
- condition: qbs.targetOS.contains("darwin")
+ condition: isForDarwin
bundle.isBundle: false
}
}