From d5a8adc1560135a46ff4aac2dbced1a7b4acfbd6 Mon Sep 17 00:00:00 2001
From: Fawzi Mohamed <fawzi.mohamed@digia.com>
Date: Fri, 29 Nov 2013 01:20:00 +0100
Subject: [PATCH] ios: ensure that the private dependencies are resolved by
 dyld

Change-Id: I36f493dc83a906fb2291b156488531cfff633d4a
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
---
 src/plugins/ios/iostoolhandler.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/plugins/ios/iostoolhandler.cpp b/src/plugins/ios/iostoolhandler.cpp
index c1984f22751..a70d9152a0a 100644
--- a/src/plugins/ios/iostoolhandler.cpp
+++ b/src/plugins/ios/iostoolhandler.cpp
@@ -42,6 +42,7 @@
 #include <QList>
 #include <QScopedArrayPointer>
 #include <QProcessEnvironment>
+#include <QFileInfo>
 
 #include <string.h>
 #include <errno.h>
@@ -203,6 +204,12 @@ IosToolHandlerPrivate::IosToolHandlerPrivate(IosToolHandler::DeviceType devType,
     foreach (const QString &k, env.keys())
         if (k.startsWith(QLatin1String("DYLD_")))
             env.remove(k);
+    QString xcPath = IosConfigurations::developerPath().appendPath(QLatin1String("../OtherFrameworks")).toFileInfo().canonicalFilePath();
+    env.insert(QLatin1String("DYLD_FALLBACK_FRAMEWORK_PATH"),
+               xcPath.isEmpty() ?
+                   QLatin1String("/System/Library/PrivateFrameworks")
+                 : (xcPath + QLatin1String(":/System/Library/PrivateFrameworks")));
+
     process.setProcessEnvironment(env);
     QObject::connect(&process, SIGNAL(readyReadStandardOutput()), q, SLOT(subprocessHasData()));
     QObject::connect(&process, SIGNAL(finished(int,QProcess::ExitStatus)),
-- 
GitLab