Add explicit support to use jom instead of nmake (which does not support -j)

jom can be found at http://qt.gitorious.org/qt-labs/jom

Reviewed-by: Daniel Molkentin <daniel.molkentin@nokia.com>
This commit is contained in:
dt
2009-08-12 15:20:36 +02:00
committed by Daniel Molkentin
parent 73db6ba48c
commit ac3e37fc6e
5 changed files with 30 additions and 1 deletions

View File

@@ -652,6 +652,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
m_projectExplorerSettings.buildBeforeRun = s->value("ProjectExplorer/Settings/BuildBeforeRun", true).toBool();
m_projectExplorerSettings.saveBeforeBuild = s->value("ProjectExplorer/Settings/SaveBeforeBuild", false).toBool();
m_projectExplorerSettings.showCompilerOutput = s->value("ProjectExplorer/Settings/ShowCompilerOutput", false).toBool();
m_projectExplorerSettings.useJom = s->value("ProjectExplorer/Settings/UseJom", true).toBool();
}
connect(m_sessionManagerAction, SIGNAL(triggered()), this, SLOT(showSessionManager()));
@@ -892,6 +893,7 @@ void ProjectExplorerPlugin::savePersistentSettings()
s->setValue("ProjectExplorer/Settings/BuildBeforeRun", m_projectExplorerSettings.buildBeforeRun);
s->setValue("ProjectExplorer/Settings/SaveBeforeBuild", m_projectExplorerSettings.saveBeforeBuild);
s->setValue("ProjectExplorer/Settings/ShowCompilerOutput", m_projectExplorerSettings.showCompilerOutput);
s->setValue("ProjectExplorer/Settings/UseJom", m_projectExplorerSettings.useJom);
}
}

View File

@@ -80,6 +80,7 @@ struct ProjectExplorerSettings
bool buildBeforeRun;
bool saveBeforeBuild;
bool showCompilerOutput;
bool useJom;
};
} // namespace Internal

View File

@@ -73,6 +73,11 @@ QWidget *ProjectExplorerSettingsPage::createPage(QWidget *parent)
m_ui.buildProjectBeforeRunCheckBox->setChecked(pes.buildBeforeRun);
m_ui.saveAllFilesCheckBox->setChecked(pes.saveBeforeBuild);
m_ui.showCompileOutputCheckBox->setChecked(pes.showCompilerOutput);
#ifdef Q_OS_WIN
m_ui.jomCheckbox->setChecked(pes.useJom);
#else
m_ui.jomCheckbox->setVisible(false);
#endif
return w;
}
@@ -82,6 +87,9 @@ void ProjectExplorerSettingsPage::apply()
pes.buildBeforeRun = m_ui.buildProjectBeforeRunCheckBox->isChecked();
pes.saveBeforeBuild = m_ui.saveAllFilesCheckBox->isChecked();
pes.showCompilerOutput = m_ui.showCompileOutputCheckBox->isChecked();
#ifdef Q_OS_WIN
pes.useJom = m_ui.jomCheckbox->isChecked();
#endif
ProjectExplorerPlugin::instance()->setProjectExplorerSettings(pes);
}

View File

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>296</width>
<height>152</height>
<height>249</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
@@ -38,6 +38,16 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="jomCheckbox">
<property name="whatsThis">
<string/>
</property>
<property name="text">
<string>Use jom instead of nmake</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View File

@@ -374,6 +374,14 @@ void MSVCToolChain::addToEnvironment(ProjectExplorer::Environment &env)
QString MSVCToolChain::makeCommand() const
{
if (ProjectExplorerPlugin::instance()->projectExplorerSettings().useJom) {
// We want jom! Try to find it.
QString jom = QCoreApplication::applicationDirPath() + QLatin1String("/jom.exe");
if (QFileInfo(jom).exists())
return jom;
else
return "jom.exe";
}
return "nmake.exe";
}