summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-08-13 09:46:17 +0200
committerLiang Qi <liang.qi@qt.io>2019-08-13 10:20:13 +0200
commit275ad4ce4cc568c5bb07c00dcffb28a096d45c2b (patch)
tree883f978cb9479614a016be485862c9f62e9f2f0a /qmake
parent42d32e468aa89631161884f07b3e25814c47b879 (diff)
parent1dade1bd8ad13a16152aff36351ac570b5b9fdf6 (diff)
Merge "Merge remote-tracking branch 'origin/5.13' into dev"
Diffstat (limited to 'qmake')
-rw-r--r--qmake/doc/src/qmake-manual.qdoc10
-rw-r--r--qmake/generators/unix/unixmake2.cpp38
2 files changed, 38 insertions, 10 deletions
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc
index b271abcee3..3495f97b2c 100644
--- a/qmake/doc/src/qmake-manual.qdoc
+++ b/qmake/doc/src/qmake-manual.qdoc
@@ -2583,10 +2583,8 @@
\section1 RC_FILE
- Specifies the name of the resource file for the application.
- The value of this variable is typically handled by
- qmake or \l{#QMAKESPEC}{qmake.conf} and rarely
- needs to be modified.
+ Windows only. Specifies the name of the Windows resource file (.rc) for the
+ target. See \l{Adding Windows Resource Files}.
\target RC_CODEPAGE
\section1 RC_CODEPAGE
@@ -2649,7 +2647,9 @@
\section1 RES_FILE
- Specifies the name of the compiled Windows resource file for the target.
+ Windows only. Specifies the name of the Windows resource compiler's output
+ file for this target. See \l{RC_FILE} and \l{Adding Windows Resource Files}.
+
The value of this variable is typically handled by
qmake or \l{#QMAKESPEC}{qmake.conf} and rarely
needs to be modified.
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index 8d1bd08197..8b4f2bf58f 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -1447,7 +1447,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)
@@ -1485,12 +1514,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();