summaryrefslogtreecommitdiffstats
path: root/qmake/generators
diff options
context:
space:
mode:
Diffstat (limited to 'qmake/generators')
-rw-r--r--qmake/generators/metamakefile.cpp4
-rw-r--r--qmake/generators/unix/unixmake.cpp7
-rw-r--r--qmake/generators/win32/winmakefile.cpp42
3 files changed, 43 insertions, 10 deletions
diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp
index 22a72100f7..b8b93bc8cb 100644
--- a/qmake/generators/metamakefile.cpp
+++ b/qmake/generators/metamakefile.cpp
@@ -252,6 +252,10 @@ void BuildsMetaMakefileGenerator::checkForConflictingTargets() const
// and the last entry in makefiles is the "glue" Build.
return;
}
+ if (!project->isActiveConfig("build_all")) {
+ // Only complain if we're about to build all configurations.
+ return;
+ }
using TargetInfo = std::pair<Build *, ProString>;
QVector<TargetInfo> targets;
const int last = makefiles.count() - 1;
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp
index 71bf72100e..f4bc0e47ea 100644
--- a/qmake/generators/unix/unixmake.cpp
+++ b/qmake/generators/unix/unixmake.cpp
@@ -433,12 +433,9 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
QMakeLocalFileName f(opt.mid(2));
if (!frameworkdirs.contains(f))
frameworkdirs.insert(fwidx++, f);
- } else if (target_mode == TARG_MAC_MODE && opt.startsWith("-framework")) {
+ } else if (target_mode == TARG_MAC_MODE && opt == "-framework") {
if (linkPrl) {
- if (opt.length() == 10)
- opt = (*++it).toQString();
- else
- opt = opt.mid(10).trimmed();
+ opt = (*++it).toQString();
static const QChar suffixMarker = ',';
const int suffixPosition = opt.indexOf(suffixMarker);
const bool hasSuffix = suffixPosition >= 0;
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index 27d2a7c0a5..86d10c213c 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -38,6 +38,8 @@
#include <qdir.h>
#include <stdlib.h>
+#include <algorithm>
+
QT_BEGIN_NAMESPACE
ProString Win32MakefileGenerator::fixLibFlag(const ProString &lib)
@@ -73,16 +75,37 @@ Win32MakefileGenerator::parseLibFlag(const ProString &flag, ProString *arg)
return LibFlagFile;
}
+class LibrarySearchPath : public QMakeLocalFileName
+{
+public:
+ LibrarySearchPath() = default;
+
+ LibrarySearchPath(const QString &s)
+ : QMakeLocalFileName(s)
+ {
+ }
+
+ LibrarySearchPath(QString &&s, bool isDefault = false)
+ : QMakeLocalFileName(std::move(s)), _default(isDefault)
+ {
+ }
+
+ bool isDefault() const { return _default; }
+
+private:
+ bool _default = false;
+};
+
bool
Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
{
ProStringList impexts = project->values("QMAKE_LIB_EXTENSIONS");
if (impexts.isEmpty())
impexts = project->values("QMAKE_EXTENSION_STATICLIB");
- QVector<QMakeLocalFileName> dirs;
+ QVector<LibrarySearchPath> dirs;
int libidx = 0;
for (const ProString &dlib : project->values("QMAKE_DEFAULT_LIBDIRS"))
- dirs.append(QMakeLocalFileName(dlib.toQString()));
+ dirs.append(LibrarySearchPath(dlib.toQString(), true));
static const char * const lflags[] = { "LIBS", "LIBS_PRIVATE",
"QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", nullptr };
for (int i = 0; lflags[i]; i++) {
@@ -92,12 +115,20 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
ProString arg;
LibFlagType type = parseLibFlag(opt, &arg);
if (type == LibFlagPath) {
- QMakeLocalFileName lp(arg.toQString());
- int idx = dirs.indexOf(lp);
+ const QString argqstr = arg.toQString();
+ auto dit = std::find_if(dirs.cbegin(), dirs.cend(),
+ [&argqstr](const LibrarySearchPath &p)
+ {
+ return p.real() == argqstr;
+ });
+ int idx = dit == dirs.cend()
+ ? -1
+ : std::distance(dirs.cbegin(), dit);
if (idx >= 0 && idx < libidx) {
it = l.erase(it);
continue;
}
+ const LibrarySearchPath lp(argqstr);
dirs.insert(libidx++, lp);
(*it) = "-L" + lp.real();
} else if (type == LibFlagLib) {
@@ -114,7 +145,8 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
for (ProStringList::ConstIterator extit = impexts.cbegin();
extit != impexts.cend(); ++extit) {
if (exists(libBase + '.' + *extit)) {
- (*it) = cand + verovr + '.' + *extit;
+ *it = (dir_it->isDefault() ? lib : cand)
+ + verovr + '.' + *extit;
goto found;
}
}