Skip to content
Snippets Groups Projects
Commit b47d279b authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Do sanity checks when running qmake

 * Check for symbian SDK and soureces being on the same drive on windows
 * Check for a Open C/C++ header in Symbian SDK and warn if that is not found
 * Check for chars in project name that might confuse symbian SDKs

Task-number: QTCREATORBUG-1045
Task-number: QTCREATORBUG-1043
Reviewed-by: dt
parent f7335948
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,7 @@
#include "qmakestep.h"
#include "projectexplorer/projectexplorerconstants.h"
#include "qmakeparser.h"
#include "qt4buildconfiguration.h"
#include "qt4project.h"
......@@ -37,6 +38,8 @@
#include "qt4target.h"
#include "qtversionmanager.h"
#include "qt-s60/s60manager.h"
#include <coreplugin/icore.h>
#include <utils/qtcassert.h>
......@@ -186,11 +189,54 @@ void QMakeStep::run(QFutureInterface<bool> &fi)
return;
}
// Warn on common error conditions:
if (qt4BuildConfiguration()->qt4Target()->id() == Constants::S60_DEVICE_TARGET_ID ||
qt4BuildConfiguration()->qt4Target()->id() == Constants::S60_EMULATOR_TARGET_ID)
{
QtVersion *qtVersion = qt4BuildConfiguration()->qtVersion();
const QString projectDir = QDir(qt4BuildConfiguration()->qt4Target()->qt4Project()->projectDirectory()).absolutePath();
const QString epocRootDir = QDir(Internal::S60Manager::instance()->deviceForQtVersion(qtVersion).epocRoot).absolutePath();
QFileInfo cppheader(epocRootDir + QLatin1String("/include/stdapis/string.h"));
#if defined (Q_OS_WIN)
// Report an error if project- and epoc directory are on different drives:
if (!epocRootDir.startsWith(projectDir.left(3))) {
addTask(Task(Task::Error,
tr("The Symbian SDK and the project sources must reside on the same drive."),
QString(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
fi.reportResult(false);
return;
}
#endif
// Report en error if EPOC root is not set:
if (epocRootDir.isEmpty() || !QDir(epocRootDir).exists()) {
addTask(Task(Task::Error,
tr("The Symbian SDK was not found for Qt version %1.").arg(qtVersion->displayName()),
QString(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
fi.reportResult(false);
return;
}
if (!cppheader.exists()) {
addTask(Task(Task::Error,
tr("The \"Open C/C++ plugin\" is not installed in the Symbian SDK or the Symbian SDK path is misconfigured for Qt version %1.").arg(qtVersion->displayName()),
QString(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
fi.reportResult(false);
return;
}
// Warn of strange characters in project name:
if (projectDir.contains(QRegExp("[^a-zA-Z0-9./]"))) {
addTask(Task(Task::Warning,
tr("The Symbian toolchain does not handle special characters in a project path well."),
QString(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
}
}
if (!m_needToRunQMake) {
emit addOutput(tr("<font color=\"#0000ff\">Configuration unchanged, skipping qmake step.</font>"));
fi.reportResult(true);
return;
}
AbstractProcessStep::run(fi);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment