qmake: Place prl files under Resources in framework bundles

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 <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Tor Arne Vestbø 2019-09-27 15:38:48 +02:00
parent c9478e90ff
commit 74abe98320
2 changed files with 16 additions and 9 deletions

View File

@ -448,15 +448,21 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
opt.remove(suffixMarker); // Apply suffix by removing marker
}
for (const QMakeLocalFileName &dir : qAsConst(frameworkdirs)) {
QString frameworkDirectory = dir.local() + "/" + frameworkName + + ".framework/";
QString suffixedPrl = frameworkDirectory + opt;
auto processPrlIfFound = [&](QString directory) {
QString suffixedPrl = directory + opt;
if (processPrlFile(suffixedPrl, true))
break;
return true;
if (hasSuffix) {
QString unsuffixedPrl = frameworkDirectory + frameworkName;
QString unsuffixedPrl = directory + frameworkName;
if (processPrlFile(unsuffixedPrl, true))
break;
return true;
}
return false;
};
QString frameworkDirectory = dir.local() + "/" + frameworkName + + ".framework/";
if (processPrlIfFound(frameworkDirectory + "Resources/")
|| processPrlIfFound(frameworkDirectory))
break;
}
} else {
if (opt.length() == 10)

View File

@ -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("/");