diff options
author | Liang Qi <liang.qi@qt.io> | 2019-08-05 09:28:48 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-08-05 09:28:48 +0200 |
commit | f3b28e80211881ab78879eb5acbf5de5d1b1e38c (patch) | |
tree | cf283c7a44bdfc4113d48ec12daa0c3d711aae99 /qmake | |
parent | 4d7271087e84096abd75fa806bea234daee0cd94 (diff) | |
parent | 8c0787cfa1a906ebe25907515d86050303b127e7 (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
qmake/generators/unix/unixmake2.cpp
src/plugins/platforms/cocoa/qcocoawindow.mm
Change-Id: Iba7aa7324f35543e0297a3680956420058cd3630
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/generators/unix/unixmake2.cpp | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 731821020b..c326692ded 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -1454,7 +1454,36 @@ UnixMakefileGenerator::libtoolFileName(bool fixify) void UnixMakefileGenerator::writeLibtoolFile() { + auto fixDependencyLibs + = [this](const ProStringList &libs) + { + ProStringList result; + for (auto lib : libs) { + auto fi = fileInfo(lib.toQString()); + if (fi.isAbsolute()) { + const QString libDirArg = "-L" + fi.path(); + if (!result.contains(libDirArg)) + result += libDirArg; + QString namespec = fi.fileName(); + int dotPos = namespec.lastIndexOf('.'); + if (dotPos != -1 && namespec.startsWith("lib")) { + namespec.truncate(dotPos); + namespec.remove(0, 3); + } else { + debug_msg(1, "Ignoring dependency library %s", + lib.toLatin1().constData()); + continue; + } + result += "-l" + namespec; + } else { + result += lib; + } + } + return result; + }; + QString fname = libtoolFileName(), lname = fname; + debug_msg(1, "Writing libtool file %s", fname.toLatin1().constData()); mkdir(fileInfo(fname).path()); int slsh = lname.lastIndexOf(Option::dir_sep); if(slsh != -1) @@ -1492,12 +1521,11 @@ UnixMakefileGenerator::writeLibtoolFile() << ".a'\n\n"; t << "# Libraries that this one depends upon.\n"; + static const ProKey libVars[] = { "LIBS", "QMAKE_LIBS" }; ProStringList libs; - libs << "LIBS" << "QMAKE_LIBS"; - t << "dependency_libs='"; - for (ProStringList::ConstIterator it = libs.cbegin(); it != libs.cend(); ++it) - t << fixLibFlags((*it).toKey()).join(' ') << ' '; - t << "'\n\n"; + for (auto var : libVars) + libs += fixLibFlags(var); + t << "dependency_libs='" << fixDependencyLibs(libs).join(' ') << "'\n\n"; t << "# Version information for " << lname << "\n"; int maj = project->first("VER_MAJ").toInt(); |