Run make clean on clicking rebuild for the debugging helper library.

This commit is contained in:
dt
2009-04-16 17:12:19 +02:00
parent 3e9ded4351
commit dec4acdbf2

View File

@@ -1424,16 +1424,12 @@ QString QtVersion::buildDebuggingHelperLibrary()
if (!success) if (!success)
continue; continue;
output += QString("Building debugging helper library in %1\n").arg(directory); // Setup process
output += "\n"; QProcess proc;
output += QString("Runinng %1 ...\n").arg(qmakeCommand());
QProcess qmake;
ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment(); ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment();
addToEnvironment(env); addToEnvironment(env);
// TODO this is a hack to get, to be removed and rewritten for 1.2 // TODO this is a hack to get, to be removed and rewritten for 1.2
//
// For MSVC and MINGW, we need a toolchain to get the right environment // For MSVC and MINGW, we need a toolchain to get the right environment
ProjectExplorer::ToolChain *toolChain = 0; ProjectExplorer::ToolChain *toolChain = 0;
ProjectExplorer::ToolChain::ToolChainType t = toolchainType(); ProjectExplorer::ToolChain::ToolChainType t = toolchainType();
@@ -1447,23 +1443,20 @@ QString QtVersion::buildDebuggingHelperLibrary()
toolChain = 0; toolChain = 0;
} }
qmake.setEnvironment(env.toStringList()); proc.setEnvironment(env.toStringList());
qmake.setWorkingDirectory(directory); proc.setWorkingDirectory(directory);
qmake.setProcessChannelMode(QProcess::MergedChannels); proc.setProcessChannelMode(QProcess::MergedChannels);
qmake.start(qmakeCommand(), QStringList()<<"-spec"<< mkspec() <<"gdbmacros.pro"); output += QString("Building debugging helper library in %1\n").arg(directory);
qmake.waitForFinished(); output += "\n";
output += qmake.readAll();
QString make;
// TODO this is butt ugly // TODO this is butt ugly
// only qt4projects have a toolchain() method. (Reason mostly, that in order to create // only qt4projects have a toolchain() method. (Reason mostly, that in order to create
// the toolchain, we need to have the path to gcc // the toolchain, we need to have the path to gcc
// which might depend on environment settings of the project // which might depend on environment settings of the project
// so we hardcode the toolchainType to make conversation here // so we hardcode the toolchainType to make conversation here
// and think about how to fix that later // and think about how to fix that later
QString make;
if (t == ProjectExplorer::ToolChain::MinGW) if (t == ProjectExplorer::ToolChain::MinGW)
make = "mingw32-make.exe"; make = "mingw32-make.exe";
else if(t == ProjectExplorer::ToolChain::MSVC || t == ProjectExplorer::ToolChain::WINCE) else if(t == ProjectExplorer::ToolChain::MSVC || t == ProjectExplorer::ToolChain::WINCE)
@@ -1472,12 +1465,29 @@ QString QtVersion::buildDebuggingHelperLibrary()
make = "make"; make = "make";
QString makeFullPath = env.searchInPath(make); QString makeFullPath = env.searchInPath(make);
if (!makeFullPath.isEmpty()) {
output += QString("Running %1 clean...\n").arg(makeFullPath);
proc.start(makeFullPath, QStringList() << "clean");
proc.waitForFinished();
output += proc.readAll();
} else {
output += QString("%1 not found in PATH\n").arg(make);
break;
}
output += QString("\nRuninng %1 ...\n").arg(qmakeCommand());
proc.start(qmakeCommand(), QStringList()<<"-spec"<< mkspec() <<"gdbmacros.pro");
proc.waitForFinished();
output += proc.readAll();
output += "\n"; output += "\n";
if (!makeFullPath.isEmpty()) { if (!makeFullPath.isEmpty()) {
output += QString("Running %1 ...\n").arg(makeFullPath); output += QString("Running %1 ...\n").arg(makeFullPath);
qmake.start(makeFullPath, QStringList()); proc.start(makeFullPath, QStringList());
qmake.waitForFinished(); proc.waitForFinished();
output += qmake.readAll(); output += proc.readAll();
} else { } else {
output += QString("%1 not found in PATH\n").arg(make); output += QString("%1 not found in PATH\n").arg(make);
} }