From 74abe983204dab35dcce59001308c54d34ad2c02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 27 Sep 2019 15:38:48 +0200 Subject: [PATCH] qmake: Place prl files under Resources in framework bundles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The root of the framework bundle shouldn't contain random files, and doing so will prevent the bundle from being signable. We still look up prl files in the root, to keep backwards compatibility. Change-Id: Ifd0bc3c6e7924e89eec54d3ef9368dfc95ed402c Reviewed-by: Simon Hausmann Reviewed-by: Tor Arne Vestbø --- qmake/generators/unix/unixmake.cpp | 20 +++++++++++++------- qmake/generators/unix/unixmake2.cpp | 5 +++-- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 664c81296cf..71bf72100e3 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -448,15 +448,21 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) opt.remove(suffixMarker); // Apply suffix by removing marker } for (const QMakeLocalFileName &dir : qAsConst(frameworkdirs)) { + auto processPrlIfFound = [&](QString directory) { + QString suffixedPrl = directory + opt; + if (processPrlFile(suffixedPrl, true)) + return true; + if (hasSuffix) { + QString unsuffixedPrl = directory + frameworkName; + if (processPrlFile(unsuffixedPrl, true)) + return true; + } + return false; + }; QString frameworkDirectory = dir.local() + "/" + frameworkName + + ".framework/"; - QString suffixedPrl = frameworkDirectory + opt; - if (processPrlFile(suffixedPrl, true)) + if (processPrlIfFound(frameworkDirectory + "Resources/") + || processPrlIfFound(frameworkDirectory)) break; - if (hasSuffix) { - QString unsuffixedPrl = frameworkDirectory + frameworkName; - if (processPrlFile(unsuffixedPrl, true)) - break; - } } } else { if (opt.length() == 10) diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index ccb601d4b8f..79d19cae8c9 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -1230,8 +1230,9 @@ void UnixMakefileGenerator::init2() else ar_cmd.append("$(AR) $(TARGETA) $(OBJECTS)"); if (!project->isEmpty("QMAKE_BUNDLE")) { - project->values("PRL_TARGET").prepend( - project->first("QMAKE_BUNDLE") + Option::dir_sep + project->first("TARGET")); + project->values("PRL_TARGET").prepend(project->first("QMAKE_BUNDLE") + + "/Versions/" + project->first("QMAKE_FRAMEWORK_VERSION") + + "/Resources/" + project->first("TARGET")); ProString bundle_loc = project->first("QMAKE_BUNDLE_LOCATION"); if(!bundle_loc.isEmpty() && !bundle_loc.startsWith("/")) bundle_loc.prepend("/");