From 070aec28e6e218c4f5fc2e3bb480cfc7684728d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 18 Apr 2018 14:09:12 +0200 Subject: qmake: Fix prl lookup for suffixed frameworks on Apple platforms We need to take into account the presence of a possible ',_debug' suffix. Change-Id: I5655394b78723bbc6cc32e56849acc2366d288e2 Reviewed-by: Oswald Buddenhagen --- qmake/generators/unix/unixmake.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'qmake/generators/unix') diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 30f99174f8..894020d2bd 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -461,10 +461,24 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) opt = (*++it).toQString(); else opt = opt.mid(10).trimmed(); + static const QChar suffixMarker = ','; + const int suffixPosition = opt.indexOf(suffixMarker); + const bool hasSuffix = suffixPosition >= 0; + QString frameworkName = opt; + if (hasSuffix) { + frameworkName.truncate(suffixPosition); + opt.remove(suffixMarker); // Apply suffix by removing marker + } for (const QMakeLocalFileName &dir : qAsConst(frameworkdirs)) { - QString prl = dir.local() + "/" + opt + ".framework/" + opt + Option::prl_ext; - if (processPrlFile(prl)) + QString frameworkDirectory = dir.local() + "/" + frameworkName + + ".framework/"; + QString suffixedPrl = frameworkDirectory + opt + Option::prl_ext; + if (processPrlFile(suffixedPrl)) break; + if (hasSuffix) { + QString unsuffixedPrl = frameworkDirectory + frameworkName + Option::prl_ext; + if (processPrlFile(unsuffixedPrl)) + break; + } } } else { if (opt.length() == 10) -- cgit v1.2.3