Show test compile command if compile command failed
MODIFY
src/ccmanager.cpp
src/ccmanager.cpp
@@ -139,6 +139,7 @@ CCManager::CCRes CCManager::compile(const QStringList& files, QString outname, b
const bool success = LoadDialog::validateELFFile(QFile(outname)).valid;
res.success = success;
res.aborted = m_aborted;
+ res.compileCommand = cc + " " + args.join(" ");
return res;
}
@@ -225,6 +226,8 @@ CCManager::CCRes CCManager::verifyCC(const QString& CCPath) {
if (!res.success) {
res.errorMessage += "Failed to compile test program.\n";
+ res.errorMessage += "Compile command was: \n";
+ res.errorMessage += "\t" + res.compileCommand + "\n";
res.errorMessage += "Compiler output:\n";
res.errorMessage += "\tstdout: " + QString(m_process.readAllStandardOutput()) + "\n";
res.errorMessage += "\tstderr: " + QString(m_process.readAllStandardError()) + "\n";

MODIFY
src/ccmanager.h
src/ccmanager.h
@@ -20,6 +20,7 @@ public:
QStringList inFiles;
QString outFile;
QString errorMessage;
+ QString compileCommand;
bool success = false;
bool aborted = false;

MODIFY
src/settingsdialog.cpp
src/settingsdialog.cpp
@@ -205,6 +205,9 @@ QWidget* SettingsDialog::createCompilerPage() {
// Add effective compile command line view
auto* CCCLineHLayout = new QHBoxLayout();
m_compileInfoHeader = new QLabel();
+ auto f = m_compileInfoHeader->font();
+ f.setBold(true);
+ m_compileInfoHeader->setFont(f);
CCCLineHLayout->addWidget(m_compileInfoHeader);
m_compileInfo = new QLabel();
m_compileInfo->setWordWrap(true);

Show test compile command if compile command failed