diff options
Diffstat (limited to 'qmake/generators/win32/winmakefile.cpp')
-rw-r--r-- | qmake/generators/win32/winmakefile.cpp | 43 |
1 files changed, 32 insertions, 11 deletions
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index bca27b7044..e0d03ccc1c 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -84,7 +84,8 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) if (impexts.isEmpty()) impexts = project->values("QMAKE_EXTENSION_STATICLIB"); QList<QMakeLocalFileName> dirs; - static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 }; + static const char * const lflags[] = { "LIBS", "LIBS_PRIVATE", + "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", nullptr }; for (int i = 0; lflags[i]; i++) { ProStringList &l = project->values(lflags[i]); for (ProStringList::Iterator it = l.begin(); it != l.end();) { @@ -106,7 +107,7 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) for (QList<QMakeLocalFileName>::Iterator dir_it = dirs.begin(); dir_it != dirs.end(); ++dir_it) { QString cand = (*dir_it).real() + Option::dir_sep + lib; - if (linkPrl && processPrlFile(cand)) { + if (linkPrl && processPrlFile(cand, true)) { (*it) = cand; goto found; } @@ -124,13 +125,13 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) } else if (linkPrl && type == LibFlagFile) { QString lib = opt.toQString(); if (fileInfo(lib).isAbsolute()) { - if (processPrlFile(lib)) + if (processPrlFile(lib, false)) (*it) = lib; } else { for (QList<QMakeLocalFileName>::Iterator dir_it = dirs.begin(); dir_it != dirs.end(); ++dir_it) { QString cand = (*dir_it).real() + Option::dir_sep + lib; - if (processPrlFile(cand)) { + if (processPrlFile(cand, false)) { (*it) = cand; break; } @@ -163,12 +164,30 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) return true; } +bool Win32MakefileGenerator::processPrlFileBase(QString &origFile, const QStringRef &origName, + const QStringRef &fixedBase, int slashOff) +{ + if (MakefileGenerator::processPrlFileBase(origFile, origName, fixedBase, slashOff)) + return true; + for (int off = fixedBase.length(); off > slashOff; off--) { + if (!fixedBase.at(off - 1).isDigit()) { + if (off != fixedBase.length()) { + return MakefileGenerator::processPrlFileBase( + origFile, origName, fixedBase.left(off), slashOff); + } + break; + } + } + return false; +} + void Win32MakefileGenerator::processVars() { if (project->first("TEMPLATE").endsWith("aux")) return; - project->values("QMAKE_ORIG_TARGET") = project->values("TARGET"); + project->values("PRL_TARGET") = + project->values("QMAKE_ORIG_TARGET") = project->values("TARGET"); if (project->isEmpty("QMAKE_PROJECT_NAME")) project->values("QMAKE_PROJECT_NAME") = project->values("QMAKE_ORIG_TARGET"); else if (project->first("TEMPLATE").startsWith("vc")) @@ -207,8 +226,8 @@ void Win32MakefileGenerator::processVars() libs << QLatin1String("-L") + lib; } } - project->values("QMAKE_LIBS") += libs + project->values("LIBS"); - project->values("QMAKE_LIBS_PRIVATE") += project->values("LIBS_PRIVATE"); + ProStringList &qmklibs = project->values("LIBS"); + qmklibs = libs + qmklibs; if (project->values("TEMPLATE").contains("app")) { project->values("QMAKE_CFLAGS") += project->values("QMAKE_CFLAGS_APP"); @@ -422,7 +441,7 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t) { t << "clean: compiler_clean " << depVar("CLEAN_DEPS"); { - const char *clean_targets[] = { "OBJECTS", "QMAKE_CLEAN", "CLEAN_FILES", 0 }; + const char *clean_targets[] = { "OBJECTS", "QMAKE_CLEAN", "CLEAN_FILES", nullptr }; for(int i = 0; clean_targets[i]; ++i) { const ProStringList &list = project->values(clean_targets[i]); const QString del_statement("-$(DEL_FILE)"); @@ -451,7 +470,7 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t) t << "distclean: clean " << depVar("DISTCLEAN_DEPS"); { - const char *clean_targets[] = { "QMAKE_DISTCLEAN", 0 }; + const char *clean_targets[] = { "QMAKE_DISTCLEAN", nullptr }; for(int i = 0; clean_targets[i]; ++i) { const ProStringList &list = project->values(clean_targets[i]); const QString del_statement("-$(DEL_FILE)"); @@ -563,7 +582,7 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t) t << "DIST = " << fileVarList("DISTFILES") << ' ' << fileVarList("HEADERS") << ' ' << fileVarList("SOURCES") << endl; - t << "QMAKE_TARGET = " << fileVar("QMAKE_ORIG_TARGET") << endl; + t << "QMAKE_TARGET = " << fileVar("QMAKE_ORIG_TARGET") << endl; // unused // The comment is important to maintain variable compatibility with Unix // Makefiles, while not interpreting a trailing-slash as a linebreak t << "DESTDIR = " << escapeFilePath(destDir) << " #avoid trailing-slash linebreak\n"; @@ -633,7 +652,9 @@ void Win32MakefileGenerator::writeLibsPart(QTextStream &t) } else { t << "LINKER = " << var("QMAKE_LINK") << endl; t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl; - t << "LIBS = " << fixLibFlags("QMAKE_LIBS").join(' ') << ' ' + t << "LIBS = " << fixLibFlags("LIBS").join(' ') << ' ' + << fixLibFlags("LIBS_PRIVATE").join(' ') << ' ' + << fixLibFlags("QMAKE_LIBS").join(' ') << ' ' << fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << endl; } } |