Make .prl file generation work for iOS again.

d28073d9 creates a distinction between "mac" and
"macx". The latter is not set on iOS, which caused
MakefileGenerator::target_mode to be set to TARG_UNIX_MODE.

Check for the "mac" active config instead of "macx".
Rename TARG_MACX_MODE -> TARG_MAC_MODE.

Change-Id: I7192788c33f5723034ba76da2492379dd454f0ab
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
This commit is contained in:
Morten Johan Sørvig 2013-03-06 14:53:36 +01:00 committed by The Qt Project
parent 6c55e55307
commit c6a689f64f
3 changed files with 12 additions and 12 deletions

View File

@ -305,8 +305,8 @@ MakefileGenerator::setProjectFile(QMakeProject *p)
project = p; project = p;
if (project->isActiveConfig("win32")) if (project->isActiveConfig("win32"))
target_mode = TARG_WIN_MODE; target_mode = TARG_WIN_MODE;
else if (project->isActiveConfig("macx")) else if (project->isActiveConfig("mac"))
target_mode = TARG_MACX_MODE; target_mode = TARG_MAC_MODE;
else else
target_mode = TARG_UNIX_MODE; target_mode = TARG_UNIX_MODE;
init(); init();
@ -3236,7 +3236,7 @@ MakefileGenerator::writePkgConfigFile()
t << "Libs: "; t << "Libs: ";
QString pkgConfiglibDir; QString pkgConfiglibDir;
QString pkgConfiglibName; QString pkgConfiglibName;
if (target_mode == TARG_MACX_MODE && project->isActiveConfig("lib_bundle")) { if (target_mode == TARG_MAC_MODE && project->isActiveConfig("lib_bundle")) {
pkgConfiglibDir = "-F${libdir}"; pkgConfiglibDir = "-F${libdir}";
ProString bundle; ProString bundle;
if (!project->isEmpty("QMAKE_FRAMEWORK_BUNDLE_NAME")) if (!project->isEmpty("QMAKE_FRAMEWORK_BUNDLE_NAME"))

View File

@ -90,7 +90,7 @@ class MakefileGenerator : protected QMakeSourceFileInfo
mutable QHash<ReplaceExtraCompilerCacheKey, QString> extraCompilerVariablesCache; mutable QHash<ReplaceExtraCompilerCacheKey, QString> extraCompilerVariablesCache;
protected: protected:
enum TARG_MODE { TARG_UNIX_MODE, TARG_MACX_MODE, TARG_WIN_MODE } target_mode; enum TARG_MODE { TARG_UNIX_MODE, TARG_MAC_MODE, TARG_WIN_MODE } target_mode;
ProStringList createObjectList(const ProStringList &sources); ProStringList createObjectList(const ProStringList &sources);

View File

@ -493,7 +493,7 @@ UnixMakefileGenerator::findLibraries()
} else { } else {
stub = opt.mid(2); stub = opt.mid(2);
} }
} else if (target_mode == TARG_MACX_MODE && opt.startsWith("-framework")) { } else if (target_mode == TARG_MAC_MODE && opt.startsWith("-framework")) {
if (opt.length() == 10) if (opt.length() == 10)
++it; ++it;
// Skip // Skip
@ -607,11 +607,11 @@ UnixMakefileGenerator::processPrlFiles()
break; break;
} }
} }
} else if (target_mode == TARG_MACX_MODE && opt.startsWith("-F")) { } else if (target_mode == TARG_MAC_MODE && opt.startsWith("-F")) {
QMakeLocalFileName f(opt.right(opt.length()-2)); QMakeLocalFileName f(opt.right(opt.length()-2));
if(!frameworkdirs.contains(f)) if(!frameworkdirs.contains(f))
frameworkdirs.insert(fwidx++, f); frameworkdirs.insert(fwidx++, f);
} else if (target_mode == TARG_MACX_MODE && opt.startsWith("-framework")) { } else if (target_mode == TARG_MAC_MODE && opt.startsWith("-framework")) {
if(opt.length() > 11) if(opt.length() > 11)
opt = opt.mid(11); opt = opt.mid(11);
else else
@ -650,7 +650,7 @@ UnixMakefileGenerator::processPrlFiles()
ProKey arch("default"); ProKey arch("default");
ProString opt = l.at(lit).trimmed(); ProString opt = l.at(lit).trimmed();
if(opt.startsWith("-")) { if(opt.startsWith("-")) {
if (target_mode == TARG_MACX_MODE && opt.startsWith("-Xarch")) { if (target_mode == TARG_MAC_MODE && opt.startsWith("-Xarch")) {
if (opt.length() > 7) { if (opt.length() > 7) {
arch = opt.mid(7).toKey(); arch = opt.mid(7).toKey();
opt = l.at(++lit); opt = l.at(++lit);
@ -658,7 +658,7 @@ UnixMakefileGenerator::processPrlFiles()
} }
if (opt.startsWith(libArg) || if (opt.startsWith(libArg) ||
(target_mode == TARG_MACX_MODE && opt.startsWith("-F"))) { (target_mode == TARG_MAC_MODE && opt.startsWith("-F"))) {
if(!lflags[arch].contains(opt)) if(!lflags[arch].contains(opt))
lflags[arch].append(opt); lflags[arch].append(opt);
} else if(opt.startsWith("-l") || opt == "-pthread") { } else if(opt.startsWith("-l") || opt == "-pthread") {
@ -666,12 +666,12 @@ UnixMakefileGenerator::processPrlFiles()
if (lflags[arch].contains(opt)) if (lflags[arch].contains(opt))
lflags[arch].removeAll(opt); lflags[arch].removeAll(opt);
lflags[arch].append(opt); lflags[arch].append(opt);
} else if (target_mode == TARG_MACX_MODE && opt.startsWith("-framework")) { } else if (target_mode == TARG_MAC_MODE && opt.startsWith("-framework")) {
if(opt.length() > 11) if(opt.length() > 11)
opt = opt.mid(11); opt = opt.mid(11);
else { else {
opt = l.at(++lit); opt = l.at(++lit);
if (target_mode == TARG_MACX_MODE && opt.startsWith("-Xarch")) if (target_mode == TARG_MAC_MODE && opt.startsWith("-Xarch"))
opt = l.at(++lit); // The user has done the right thing and prefixed each part opt = l.at(++lit); // The user has done the right thing and prefixed each part
} }
bool found = false; bool found = false;
@ -833,7 +833,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
uninst.append("-$(DEL_FILE) \"" + dst_targ + "\""); uninst.append("-$(DEL_FILE) \"" + dst_targ + "\"");
if(!links.isEmpty()) { if(!links.isEmpty()) {
for(int i = 0; i < links.size(); ++i) { for(int i = 0; i < links.size(); ++i) {
if (target_mode == TARG_UNIX_MODE || target_mode == TARG_MACX_MODE) { if (target_mode == TARG_UNIX_MODE || target_mode == TARG_MAC_MODE) {
QString link = Option::fixPathToTargetOS(destdir + links[i], false); QString link = Option::fixPathToTargetOS(destdir + links[i], false);
int lslash = link.lastIndexOf(Option::dir_sep); int lslash = link.lastIndexOf(Option::dir_sep);
if(lslash != -1) if(lslash != -1)