summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorBjörn Schäpers <schaepers@kuennecke.com>2021-11-09 10:21:32 +0100
committerBjörn Schäpers <qt-codereview@hazardy.de>2021-11-29 12:27:46 +0000
commitbe7d896f4963663c5725c0c35637755c40fe3c0e (patch)
tree6e257dcf105f447ef20ecabf99867c4cb08c329a /share
parente08c3eedcddbc18b251f56f7158353d8cbec2c81 (diff)
downloadqbs-be7d896f4963663c5725c0c35637755c40fe3c0e.tar.gz
cpp Module: Implement runtimeLibrary property for MinGW
Otherwise there is no possibility to add these arguments, since cpp.linkerFlags are put into -Wl which is not correct for them. Change-Id: I4b9355e082269d390b2afc20bec1376c5d1fcd59 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Diffstat (limited to 'share')
-rw-r--r--share/qbs/modules/cpp/MingwBaseModule.qbs1
-rw-r--r--share/qbs/modules/cpp/gcc.js2
2 files changed, 3 insertions, 0 deletions
diff --git a/share/qbs/modules/cpp/MingwBaseModule.qbs b/share/qbs/modules/cpp/MingwBaseModule.qbs
index 831512c5c..e96f8ba41 100644
--- a/share/qbs/modules/cpp/MingwBaseModule.qbs
+++ b/share/qbs/modules/cpp/MingwBaseModule.qbs
@@ -44,6 +44,7 @@ GenericGCC {
windowsApiCharacterSet: "unicode"
platformDefines: base.concat(WindowsUtils.characterSetDefines(windowsApiCharacterSet))
.concat("WIN32")
+ runtimeLibrary: "dynamic"
Properties {
condition: product.multiplexByQbsProperties.contains("buildVariants")
diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js
index 13cdb4a3d..cfcaafb76 100644
--- a/share/qbs/modules/cpp/gcc.js
+++ b/share/qbs/modules/cpp/gcc.js
@@ -529,6 +529,8 @@ function linkerFlags(project, product, inputs, outputs, primaryOutput, linkerPat
Array.prototype.push.apply(escapedLinkerFlags, args);
if (useCompilerDriver)
escapedLinkerFlags = escapedLinkerFlags.concat(Cpp.collectMiscLinkerArguments(product));
+ if (product.qbs.toolchain.contains("mingw") && product.cpp.runtimeLibrary === "static")
+ escapedLinkerFlags = ['-static-libgcc', '-static-libstdc++'].concat(escapedLinkerFlags);
return escapedLinkerFlags;
}