Commit 7f58e0e8 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Improve detection of simulator Qts

 * Make this more reliable and faster using less code.

Reviewed-by: dt
parent 6d6c8e46
......@@ -1410,35 +1410,15 @@ void QtVersion::updateToolChainAndMkspec() const
else if (value == "build_all")
m_defaultConfigIsDebugAndRelease = true;
}
// Is this actually a simulator Qt?
if (configValues.contains(QLatin1String("simulator"))) {
m_targetIds.clear();
m_targetIds.insert(QLatin1String(Constants::QT_SIMULATOR_TARGET_ID));
}
delete reader;
ProFileCacheManager::instance()->decRefCount();
m_toolChainUpToDate = true;
// Check qconfig.h for QT_SIMULATOR define on desktop builds and switch the
// Qt version to Qt simulator target:
if (m_targetIds.contains(Constants::DESKTOP_TARGET_ID)) {
QString path(headerInstallPath());
path.append(QLatin1String("/Qt/qconfig.h"));
QFile qconfig(path);
if (!qconfig.exists())
return;
qconfig.open(QIODevice::ReadOnly);
QTextStream stream(&qconfig);
QString line;
bool isSimulator = false;
while (!(line = stream.readLine()).isNull()) {
if (line.startsWith(QLatin1String("#define QT_SIMULATOR"))) {
isSimulator = true;
break;
}
}
qconfig.close();
if (isSimulator) {
m_targetIds.remove(QLatin1String(Constants::DESKTOP_TARGET_ID));
m_targetIds.insert(QLatin1String(Constants::QT_SIMULATOR_TARGET_ID));
}
}
}
QString QtVersion::mwcDirectory() const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment