diff options
author | Björn Schäpers <schaepers@kuennecke.com> | 2021-11-09 10:21:32 +0100 |
---|---|---|
committer | Björn Schäpers <qt-codereview@hazardy.de> | 2021-11-29 12:27:46 +0000 |
commit | be7d896f4963663c5725c0c35637755c40fe3c0e (patch) | |
tree | 6e257dcf105f447ef20ecabf99867c4cb08c329a /share | |
parent | e08c3eedcddbc18b251f56f7158353d8cbec2c81 (diff) | |
download | qbs-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.qbs | 1 | ||||
-rw-r--r-- | share/qbs/modules/cpp/gcc.js | 2 |
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; } |