diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2018-01-27 08:39:17 +0100 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2018-05-03 12:08:04 +0000 |
commit | 919846e91262cf8304be9568c91fea69a29355af (patch) | |
tree | 7d8d71eabf7a502a18b93adc864236296e5d3505 | |
parent | cca9acb7ffc9fdc85143deebb981e3f7b87b97d2 (diff) |
wasm: add workaround for duplicate “-s”
qmake outputs compiler lines like
“-s -s -s -s -s -s -s USE_FREETYPE=1”,
where the compiler promptly, and annoyingly, prints
a warning for each of the duplicates.
Fixup the output in fixLibFlags by removing the duplicates.
Change-Id: I024fbf7cab089d620216b1c8114baa586cb6af9d
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
-rw-r--r-- | qmake/generators/makefile.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 82573347b6..254cb1a1a7 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2782,8 +2782,18 @@ MakefileGenerator::fixLibFlags(const ProKey &var) ProStringList ret; ret.reserve(in.length()); - for (const ProString &v : in) - ret << fixLibFlag(v); + for (int i = 0; i < in.length(); ++i) { + ProString str = in[i]; + + // Remove superfluous "-s" flags. Skip "-s" if followed by + // something that does not need it, like "-s" or "-lfoo" + int j = i + 1; + bool isS = str.toQString() == QStringLiteral("-s"); + if (isS && j < in.length() && in[j].toQString().startsWith('-')) + continue; + + ret << fixLibFlag(str); + } return ret; } |