From 2e3a58501395ef3812ca987bec093ff286cb63f1 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Thu, 18 Feb 2016 01:01:38 -0800 Subject: qmake: Use correct CFBundleExecutable in framework bundles This fixes a bug where joined device and simulator builds would get for example, QtCore_iphonesimulator as the CFBundleExecutable. According to Apple: "For frameworks, the value of this key is REQUIRED to be the same as the framework name, minus the .framework extension." This does not affect the ability to load a framework whose executable name differs from the bundle name (as is the case for simulator builds), as the application will be linked to the correct framework executable at link time by specifying (for example) the linker flag: -framework QtCore,_iphonesimulator Change-Id: Ib7614670d0620e0235cd7e2606d42dd034a90c68 Reviewed-by: Oswald Buddenhagen Reviewed-by: Gabriel de Dietrich --- qmake/generators/mac/pbuilder_pbx.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'qmake/generators/mac') diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index b53b862b87..09581879ef 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -1480,9 +1480,15 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) plist_in_text.replace(QLatin1String("@ICON@"), (project->isEmpty("ICON") ? QString("") : project->first("ICON").toQString().section(Option::dir_sep, -1))); if (project->first("TEMPLATE") == "app") { - plist_in_text.replace(QLatin1String("@EXECUTABLE@"), project->first("QMAKE_ORIG_TARGET").toQString()); + ProString app_bundle_name = project->first("QMAKE_APPLICATION_BUNDLE_NAME"); + if (app_bundle_name.isEmpty()) + app_bundle_name = project->first("QMAKE_ORIG_TARGET"); + plist_in_text.replace(QLatin1String("@EXECUTABLE@"), app_bundle_name.toQString()); } else { - plist_in_text.replace(QLatin1String("@LIBRARY@"), project->first("QMAKE_ORIG_TARGET").toQString()); + ProString lib_bundle_name = project->first("QMAKE_FRAMEWORK_BUNDLE_NAME"); + if (lib_bundle_name.isEmpty()) + lib_bundle_name = project->first("QMAKE_ORIG_TARGET"); + plist_in_text.replace(QLatin1String("@LIBRARY@"), lib_bundle_name.toQString()); } QString bundlePrefix = project->first("QMAKE_TARGET_BUNDLE_PREFIX").toQString(); if (bundlePrefix.isEmpty()) -- cgit v1.2.3