- enhancement: Support compile asm files using nasm in the project.
This commit is contained in:
parent
62737d6716
commit
78ff319a75
1
NEWS.md
1
NEWS.md
|
@ -12,6 +12,7 @@ Red Panda C++ Version 2.11
|
||||||
- enhancement: Auto reload openned project files that use "Project Default" as the encoding, when the project encoding setting is changed in the project options dialog.
|
- enhancement: Auto reload openned project files that use "Project Default" as the encoding, when the project encoding setting is changed in the project options dialog.
|
||||||
- fix: Correctly handle files whose name contains spaces in the generated makefile.
|
- fix: Correctly handle files whose name contains spaces in the generated makefile.
|
||||||
- fix: Correctly handle custom obj folder in the generated makefile.
|
- fix: Correctly handle custom obj folder in the generated makefile.
|
||||||
|
- enhancement: Support compile asm files using nasm in the project.
|
||||||
|
|
||||||
Red Panda C++ Version 2.10
|
Red Panda C++ Version 2.10
|
||||||
|
|
||||||
|
|
|
@ -156,7 +156,11 @@ void ProjectCompiler::writeMakeDefines(QFile &file)
|
||||||
// Only process source files
|
// Only process source files
|
||||||
QString RelativeName = extractRelativePath(mProject->directory(), unit->fileName());
|
QString RelativeName = extractRelativePath(mProject->directory(), unit->fileName());
|
||||||
FileType fileType = getFileType(RelativeName);
|
FileType fileType = getFileType(RelativeName);
|
||||||
if (fileType == FileType::CSource || fileType == FileType::CppSource) {
|
if (fileType==FileType::ASM && !compilerSet()->canAssemble())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (fileType == FileType::CSource || fileType == FileType::CppSource
|
||||||
|
|| fileType == FileType::ASM) {
|
||||||
if (!mProject->options().objectOutput.isEmpty()) {
|
if (!mProject->options().objectOutput.isEmpty()) {
|
||||||
// ofile = C:\MyProgram\obj\main.o
|
// ofile = C:\MyProgram\obj\main.o
|
||||||
QString fullObjFile = includeTrailingPathDelimiter(mProject->options().objectOutput)
|
QString fullObjFile = includeTrailingPathDelimiter(mProject->options().objectOutput)
|
||||||
|
@ -201,11 +205,11 @@ void ProjectCompiler::writeMakeDefines(QFile &file)
|
||||||
QString relativeResFile = extractRelativePath(mProject->directory(), fullResFile);
|
QString relativeResFile = extractRelativePath(mProject->directory(), fullResFile);
|
||||||
objResFile = genMakePath1(relativeResFile);
|
objResFile = genMakePath1(relativeResFile);
|
||||||
objResFile2 = genMakePath2(relativeResFile);
|
objResFile2 = genMakePath2(relativeResFile);
|
||||||
cleanRes += ' ' + genMakePath1(changeFileExt(relativeResFile, OBJ_EXT)).replace("/",QDir::separator());
|
cleanRes += ' ' + genMakePath1(changeFileExt(relativeResFile, RES_EXT)).replace("/",QDir::separator());
|
||||||
} else {
|
} else {
|
||||||
objResFile = genMakePath1(changeFileExt(mProject->options().privateResource, RES_EXT));
|
objResFile = genMakePath1(changeFileExt(mProject->options().privateResource, RES_EXT));
|
||||||
objResFile2 = genMakePath2(changeFileExt(mProject->options().privateResource, RES_EXT));
|
objResFile2 = genMakePath2(changeFileExt(mProject->options().privateResource, RES_EXT));
|
||||||
cleanRes += ' ' + genMakePath1(changeFileExt(mProject->options().privateResource, OBJ_EXT)).replace("/",QDir::separator());
|
cleanRes += ' ' + genMakePath1(changeFileExt(mProject->options().privateResource, RES_EXT)).replace("/",QDir::separator());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -229,6 +233,8 @@ void ProjectCompiler::writeMakeDefines(QFile &file)
|
||||||
cppCompileArguments+= " -D__DEBUG__";
|
cppCompileArguments+= " -D__DEBUG__";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (compilerSet()->canAssemble())
|
||||||
|
writeln(file,"ASM = " + extractFileName(compilerSet()->assembler()));
|
||||||
writeln(file,"CPP = " + extractFileName(compilerSet()->cppCompiler()));
|
writeln(file,"CPP = " + extractFileName(compilerSet()->cppCompiler()));
|
||||||
writeln(file,"CC = " + extractFileName(compilerSet()->CCompiler()));
|
writeln(file,"CC = " + extractFileName(compilerSet()->CCompiler()));
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
|
@ -279,7 +285,21 @@ void ProjectCompiler::writeMakeDefines(QFile &file)
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
writeln(file,"WINDRESFLAGS = " + mProject->options().resourceCmd);
|
writeln(file,"WINDRESFLAGS = " + mProject->options().resourceCmd);
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
if (compilerSet()->canAssemble() &&
|
||||||
|
Settings::CompilerSets::isTarget64Bit(compilerSet()->target())) {
|
||||||
|
if (mProject->getCompileOption(CC_CMD_OPT_POINTER_SIZE)=="32")
|
||||||
|
writeln(file,"ASMFLAGS = -f win32");
|
||||||
|
else
|
||||||
|
writeln(file,"ASMFLAGS = -f win64");
|
||||||
|
} else {
|
||||||
|
writeln(file,"ASMFLAGS = -f win32");
|
||||||
|
}
|
||||||
|
#elif defined(Q_OS_LINUX)
|
||||||
|
writeln(file,"ASMFLAGS = -f elf64");
|
||||||
|
#elif defined(Q_OS_MACOS)
|
||||||
|
writeln(file,"ASMFLAGS = -f macho64");
|
||||||
|
#endif
|
||||||
|
|
||||||
// This needs to be put in before the clean command.
|
// This needs to be put in before the clean command.
|
||||||
if (mProject->options().type == ProjectType::DynamicLib) {
|
if (mProject->options().type == ProjectType::DynamicLib) {
|
||||||
|
@ -354,9 +374,12 @@ void ProjectCompiler::writeMakeObjFilesRules(QFile &file)
|
||||||
|
|
||||||
QList<PProjectUnit> projectUnits=mProject->unitList();
|
QList<PProjectUnit> projectUnits=mProject->unitList();
|
||||||
foreach(const PProjectUnit &unit, projectUnits) {
|
foreach(const PProjectUnit &unit, projectUnits) {
|
||||||
|
if (!unit->compile())
|
||||||
|
continue;
|
||||||
FileType fileType = getFileType(unit->fileName());
|
FileType fileType = getFileType(unit->fileName());
|
||||||
// Only process source files
|
// Only process source files
|
||||||
if (fileType!=FileType::CSource && fileType!=FileType::CppSource)
|
if (fileType!=FileType::CSource && fileType!=FileType::CppSource
|
||||||
|
&& fileType!=FileType::ASM)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
QString shortFileName = extractRelativePath(mProject->makeFileName(),unit->fileName());
|
QString shortFileName = extractRelativePath(mProject->makeFileName(),unit->fileName());
|
||||||
|
@ -459,16 +482,22 @@ void ProjectCompiler::writeMakeObjFilesRules(QFile &file)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mOnlyCheckSyntax) {
|
if (fileType==FileType::CppSource || fileType==FileType::CppSource) {
|
||||||
if (unit->compileCpp())
|
if (mOnlyCheckSyntax) {
|
||||||
writeln(file, "\t$(CPP) -c " + genMakePath1(shortFileName) + " $(CXXFLAGS) " + encodingStr);
|
if (unit->compileCpp())
|
||||||
else
|
writeln(file, "\t$(CPP) -c " + genMakePath1(shortFileName) + " $(CXXFLAGS) " + encodingStr);
|
||||||
writeln(file, "\t(CC) -c " + genMakePath1(shortFileName) + " $(CFLAGS) " + encodingStr);
|
else
|
||||||
} else {
|
writeln(file, "\t(CC) -c " + genMakePath1(shortFileName) + " $(CFLAGS) " + encodingStr);
|
||||||
if (unit->compileCpp())
|
} else {
|
||||||
writeln(file, "\t$(CPP) -c " + genMakePath1(shortFileName) + " -o " + objFileName2 + " $(CXXFLAGS) " + encodingStr);
|
if (unit->compileCpp())
|
||||||
else
|
writeln(file, "\t$(CPP) -c " + genMakePath1(shortFileName) + " -o " + objFileName2 + " $(CXXFLAGS) " + encodingStr);
|
||||||
writeln(file, "\t$(CC) -c " + genMakePath1(shortFileName) + " -o " + objFileName2 + " $(CFLAGS) " + encodingStr);
|
else
|
||||||
|
writeln(file, "\t$(CC) -c " + genMakePath1(shortFileName) + " -o " + objFileName2 + " $(CFLAGS) " + encodingStr);
|
||||||
|
}
|
||||||
|
} else if (fileType==FileType::ASM) {
|
||||||
|
if (!mOnlyCheckSyntax) {
|
||||||
|
writeln(file, "\t$(ASM) $(ASMFLAGS) " + genMakePath1(shortFileName) + " -o " + objFileName2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1261,6 +1261,11 @@ PProjectUnit Project::internalAddUnit(const QString &inFileName, PProjectModelNo
|
||||||
|
|
||||||
// Determine compilation flags
|
// Determine compilation flags
|
||||||
switch(getFileType(inFileName)) {
|
switch(getFileType(inFileName)) {
|
||||||
|
case FileType::ASM:
|
||||||
|
newUnit->setCompile(true);
|
||||||
|
newUnit->setCompileCpp(false);
|
||||||
|
newUnit->setLink(true);
|
||||||
|
break;
|
||||||
case FileType::CSource:
|
case FileType::CSource:
|
||||||
newUnit->setCompile(true);
|
newUnit->setCompile(true);
|
||||||
newUnit->setCompileCpp(false);
|
newUnit->setCompileCpp(false);
|
||||||
|
|
|
@ -1692,6 +1692,7 @@ Settings::CompilerSet::CompilerSet(const Settings::CompilerSet &set):
|
||||||
mProfiler(set.mProfiler),
|
mProfiler(set.mProfiler),
|
||||||
mResourceCompiler(set.mResourceCompiler),
|
mResourceCompiler(set.mResourceCompiler),
|
||||||
mDebugServer(set.mDebugServer),
|
mDebugServer(set.mDebugServer),
|
||||||
|
mAssembler(set.assembler()),
|
||||||
|
|
||||||
mBinDirs(set.mBinDirs),
|
mBinDirs(set.mBinDirs),
|
||||||
mCIncludeDirs(set.mCIncludeDirs),
|
mCIncludeDirs(set.mCIncludeDirs),
|
||||||
|
@ -2329,6 +2330,7 @@ void Settings::CompilerSet::setExecutables()
|
||||||
mMake = findProgramInBinDirs(MAKE_PROGRAM);
|
mMake = findProgramInBinDirs(MAKE_PROGRAM);
|
||||||
mResourceCompiler = findProgramInBinDirs(WINDRES_PROGRAM);
|
mResourceCompiler = findProgramInBinDirs(WINDRES_PROGRAM);
|
||||||
mProfiler = findProgramInBinDirs(GPROF_PROGRAM);
|
mProfiler = findProgramInBinDirs(GPROF_PROGRAM);
|
||||||
|
mAssembler = findProgramInBinDirs(ASSEMBLER);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::CompilerSet::setDirectories(const QString& binDir,CompilerType compilerType)
|
void Settings::CompilerSet::setDirectories(const QString& binDir,CompilerType compilerType)
|
||||||
|
@ -2506,6 +2508,11 @@ bool Settings::CompilerSet::canDebug()
|
||||||
return fileExists(mDebugger);
|
return fileExists(mDebugger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Settings::CompilerSet::canAssemble()
|
||||||
|
{
|
||||||
|
return fileExists(mAssembler);
|
||||||
|
}
|
||||||
|
|
||||||
void Settings::CompilerSet::setUserInput()
|
void Settings::CompilerSet::setUserInput()
|
||||||
{
|
{
|
||||||
mUseCustomCompileParams = false;
|
mUseCustomCompileParams = false;
|
||||||
|
@ -2551,6 +2558,16 @@ QByteArray Settings::CompilerSet::getCompilerOutput(const QString &binDir, const
|
||||||
return result.trimmed();
|
return result.trimmed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QString &Settings::CompilerSet::assembler() const
|
||||||
|
{
|
||||||
|
return mAssembler;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Settings::CompilerSet::setAssembler(const QString &newAssembler)
|
||||||
|
{
|
||||||
|
mAssembler = newAssembler;
|
||||||
|
}
|
||||||
|
|
||||||
Settings::CompilerSet::CompilationStage Settings::CompilerSet::compilationStage() const
|
Settings::CompilerSet::CompilationStage Settings::CompilerSet::compilationStage() const
|
||||||
{
|
{
|
||||||
return mCompilationStage;
|
return mCompilationStage;
|
||||||
|
@ -3073,6 +3090,8 @@ void Settings::CompilerSets::saveSet(int index)
|
||||||
savePath("make", pSet->make());
|
savePath("make", pSet->make());
|
||||||
savePath("windres", pSet->resourceCompiler());
|
savePath("windres", pSet->resourceCompiler());
|
||||||
savePath("profiler", pSet->profiler());
|
savePath("profiler", pSet->profiler());
|
||||||
|
savePath("assembler", pSet->assembler());
|
||||||
|
|
||||||
|
|
||||||
mSettings->mSettings.remove("Options");
|
mSettings->mSettings.remove("Options");
|
||||||
foreach(const PCompilerOption& option, CompilerInfoManager::getInstance()->getCompilerOptions(pSet->compilerType())) {
|
foreach(const PCompilerOption& option, CompilerInfoManager::getInstance()->getCompilerOptions(pSet->compilerType())) {
|
||||||
|
@ -3151,6 +3170,7 @@ Settings::PCompilerSet Settings::CompilerSets::loadSet(int index)
|
||||||
pSet->setMake(loadPath("make"));
|
pSet->setMake(loadPath("make"));
|
||||||
pSet->setResourceCompiler(loadPath("windres"));
|
pSet->setResourceCompiler(loadPath("windres"));
|
||||||
pSet->setProfiler(loadPath("profiler"));
|
pSet->setProfiler(loadPath("profiler"));
|
||||||
|
pSet->setAssembler(loadPath("assembler"));
|
||||||
|
|
||||||
pSet->setDumpMachine(mSettings->mSettings.value("DumpMachine").toString());
|
pSet->setDumpMachine(mSettings->mSettings.value("DumpMachine").toString());
|
||||||
pSet->setVersion(mSettings->mSettings.value("Version").toString());
|
pSet->setVersion(mSettings->mSettings.value("Version").toString());
|
||||||
|
|
|
@ -1300,6 +1300,7 @@ public:
|
||||||
bool canCompileCPP();
|
bool canCompileCPP();
|
||||||
bool canMake();
|
bool canMake();
|
||||||
bool canDebug();
|
bool canDebug();
|
||||||
|
bool canAssemble();
|
||||||
// bool dirsValid(QString& msg);
|
// bool dirsValid(QString& msg);
|
||||||
// bool validateExes(QString& msg);
|
// bool validateExes(QString& msg);
|
||||||
//properties
|
//properties
|
||||||
|
@ -1389,6 +1390,9 @@ public:
|
||||||
QString getOutputFilename(const QString& sourceFilename,Settings::CompilerSet::CompilationStage stage);
|
QString getOutputFilename(const QString& sourceFilename,Settings::CompilerSet::CompilationStage stage);
|
||||||
bool isOutputExecutable();
|
bool isOutputExecutable();
|
||||||
bool isOutputExecutable(Settings::CompilerSet::CompilationStage stage);
|
bool isOutputExecutable(Settings::CompilerSet::CompilationStage stage);
|
||||||
|
const QString &assembler() const;
|
||||||
|
void setAssembler(const QString &newAssembler);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setDirectories(const QString& binDir, CompilerType mCompilerType);
|
void setDirectories(const QString& binDir, CompilerType mCompilerType);
|
||||||
//load hard defines
|
//load hard defines
|
||||||
|
@ -1409,6 +1413,7 @@ public:
|
||||||
QString mProfiler;
|
QString mProfiler;
|
||||||
QString mResourceCompiler;
|
QString mResourceCompiler;
|
||||||
QString mDebugServer;
|
QString mDebugServer;
|
||||||
|
QString mAssembler;
|
||||||
|
|
||||||
// Directories, mostly hardcoded too
|
// Directories, mostly hardcoded too
|
||||||
QStringList mBinDirs;
|
QStringList mBinDirs;
|
||||||
|
@ -1471,6 +1476,7 @@ public:
|
||||||
|
|
||||||
QString getKeyFromCompilerCompatibleIndex(int idx) const;
|
QString getKeyFromCompilerCompatibleIndex(int idx) const;
|
||||||
|
|
||||||
|
static bool isTarget64Bit(const QString &target);
|
||||||
private:
|
private:
|
||||||
PCompilerSet addSet(const QString& folder, const QString& c_prog);
|
PCompilerSet addSet(const QString& folder, const QString& c_prog);
|
||||||
PCompilerSet addSet(const PCompilerSet &pSet);
|
PCompilerSet addSet(const PCompilerSet &pSet);
|
||||||
|
@ -1482,7 +1488,6 @@ public:
|
||||||
void loadPathList(const QString& name, QStringList& list);
|
void loadPathList(const QString& name, QStringList& list);
|
||||||
PCompilerSet loadSet(int index);
|
PCompilerSet loadSet(int index);
|
||||||
void prepareCompatibleIndex();
|
void prepareCompatibleIndex();
|
||||||
static bool isTarget64Bit(const QString &target);
|
|
||||||
private:
|
private:
|
||||||
CompilerSetList mList;
|
CompilerSetList mList;
|
||||||
int mDefaultIndex;
|
int mDefaultIndex;
|
||||||
|
|
|
@ -99,6 +99,7 @@ static void loadCompilerSetSettings(Settings::PCompilerSet pSet, Ui::CompilerSet
|
||||||
ui->txtGDBServer->setText(pSet->debugServer());
|
ui->txtGDBServer->setText(pSet->debugServer());
|
||||||
ui->txtResourceCompiler->setText(pSet->resourceCompiler());
|
ui->txtResourceCompiler->setText(pSet->resourceCompiler());
|
||||||
ui->txtProfiler->setText(pSet->profiler());
|
ui->txtProfiler->setText(pSet->profiler());
|
||||||
|
ui->txtAssembler->setText(pSet->assembler());
|
||||||
|
|
||||||
if (pSet->execCharset() == ENCODING_AUTO_DETECT
|
if (pSet->execCharset() == ENCODING_AUTO_DETECT
|
||||||
|| pSet->execCharset() == ENCODING_SYSTEM_DEFAULT
|
|| pSet->execCharset() == ENCODING_SYSTEM_DEFAULT
|
||||||
|
@ -208,6 +209,7 @@ void CompilerSetOptionWidget::saveCurrentCompilerSet()
|
||||||
pSet->setDebugServer(ui->txtGDBServer->text().trimmed());
|
pSet->setDebugServer(ui->txtGDBServer->text().trimmed());
|
||||||
pSet->setResourceCompiler(ui->txtResourceCompiler->text().trimmed());
|
pSet->setResourceCompiler(ui->txtResourceCompiler->text().trimmed());
|
||||||
pSet->setProfiler(ui->txtProfiler->text().trimmed());
|
pSet->setProfiler(ui->txtProfiler->text().trimmed());
|
||||||
|
pSet->setAssembler(ui->txtAssembler->text().trimmed());
|
||||||
|
|
||||||
pSet->binDirs()=mBinDirWidget->dirList();
|
pSet->binDirs()=mBinDirWidget->dirList();
|
||||||
|
|
||||||
|
@ -334,6 +336,7 @@ void CompilerSetOptionWidget::updateIcons(const QSize& /*size*/)
|
||||||
pIconsManager->setIcon(ui->btnChooseGDBServer, IconsManager::ACTION_FILE_OPEN_FOLDER);
|
pIconsManager->setIcon(ui->btnChooseGDBServer, IconsManager::ACTION_FILE_OPEN_FOLDER);
|
||||||
pIconsManager->setIcon(ui->btnChooseMake, IconsManager::ACTION_FILE_OPEN_FOLDER);
|
pIconsManager->setIcon(ui->btnChooseMake, IconsManager::ACTION_FILE_OPEN_FOLDER);
|
||||||
pIconsManager->setIcon(ui->btnChooseProfiler, IconsManager::ACTION_FILE_OPEN_FOLDER);
|
pIconsManager->setIcon(ui->btnChooseProfiler, IconsManager::ACTION_FILE_OPEN_FOLDER);
|
||||||
|
pIconsManager->setIcon(ui->btnChooseAssembler, IconsManager::ACTION_FILE_OPEN_FOLDER);
|
||||||
pIconsManager->setIcon(ui->btnChooseResourceCompiler, IconsManager::ACTION_FILE_OPEN_FOLDER);
|
pIconsManager->setIcon(ui->btnChooseResourceCompiler, IconsManager::ACTION_FILE_OPEN_FOLDER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -445,3 +448,15 @@ void CompilerSetOptionWidget::on_btnChooseProfiler_clicked()
|
||||||
ui->txtProfiler->setText(fileName);
|
ui->txtProfiler->setText(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CompilerSetOptionWidget::on_btnChooseAssembler_clicked()
|
||||||
|
{
|
||||||
|
QString fileName = QFileDialog::getOpenFileName(
|
||||||
|
this,
|
||||||
|
tr("Locate nasm"),
|
||||||
|
getBinDir(),
|
||||||
|
tr("Executable files (*.exe)"));
|
||||||
|
if (fileExists(fileName))
|
||||||
|
ui->txtAssembler->setText(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,7 @@ private slots:
|
||||||
void on_btnChooseGDBServer_clicked();
|
void on_btnChooseGDBServer_clicked();
|
||||||
void on_btnChooseResourceCompiler_clicked();
|
void on_btnChooseResourceCompiler_clicked();
|
||||||
void on_btnChooseProfiler_clicked();
|
void on_btnChooseProfiler_clicked();
|
||||||
|
void on_btnChooseAssembler_clicked();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // COMPILERSETOPTIONWIDGET_H
|
#endif // COMPILERSETOPTIONWIDGET_H
|
||||||
|
|
|
@ -110,7 +110,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="settingTabs">
|
<widget class="QTabWidget" name="settingTabs">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="movable">
|
<property name="movable">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
|
@ -249,10 +249,10 @@
|
||||||
<enum>QFrame::Raised</enum>
|
<enum>QFrame::Raised</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="2" column="2">
|
<item row="5" column="2">
|
||||||
<widget class="QToolButton" name="btnChooseMake">
|
<widget class="QToolButton" name="btnChooseResourceCompiler">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Choose make</string>
|
<string>Choose Resource Compiler</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>...</string>
|
<string>...</string>
|
||||||
|
@ -264,17 +264,10 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="0" column="2">
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QToolButton" name="btnChooseCCompiler">
|
||||||
<property name="text">
|
|
||||||
<string>C Compiler(gcc)</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="2">
|
|
||||||
<widget class="QToolButton" name="btnChooseProfiler">
|
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Choose Profiler</string>
|
<string>Choose C Compiler</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>...</string>
|
<string>...</string>
|
||||||
|
@ -286,8 +279,11 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1">
|
<item row="7" column="1">
|
||||||
<widget class="QLineEdit" name="txtResourceCompiler"/>
|
<widget class="QLineEdit" name="txtProfiler"/>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="QLineEdit" name="txtDebugger"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="label_3">
|
||||||
|
@ -296,6 +292,20 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="4" column="2">
|
||||||
|
<widget class="QToolButton" name="btnChooseGDBServer">
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../icons.qrc">
|
||||||
|
<normaloff>:/icons/images/newlook24/053-open.png</normaloff>:/icons/images/newlook24/053-open.png</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1">
|
||||||
|
<widget class="QLineEdit" name="txtResourceCompiler"/>
|
||||||
|
</item>
|
||||||
<item row="1" column="2">
|
<item row="1" column="2">
|
||||||
<widget class="QToolButton" name="btnChooseCppCompiler">
|
<widget class="QToolButton" name="btnChooseCppCompiler">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
|
@ -311,20 +321,18 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0">
|
<item row="7" column="2">
|
||||||
<widget class="QLabel" name="label_7">
|
<widget class="QToolButton" name="btnChooseProfiler">
|
||||||
<property name="text">
|
<property name="toolTip">
|
||||||
<string>Profiler(gprof)</string>
|
<string>Choose Profiler</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="1">
|
|
||||||
<widget class="QLineEdit" name="txtProfiler"/>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="label_4">
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>make</string>
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<normalon>:/icons/images/newlook24/053-open.png</normalon>
|
||||||
|
</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -343,54 +351,15 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="2" column="0">
|
||||||
<widget class="QLineEdit" name="txtDebugger"/>
|
<widget class="QLabel" name="label_4">
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QLineEdit" name="txtMake"/>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="2">
|
|
||||||
<widget class="QToolButton" name="btnChooseCCompiler">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Choose C Compiler</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>...</string>
|
<string>make</string>
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset>
|
|
||||||
<normalon>:/icons/images/newlook24/053-open.png</normalon>
|
|
||||||
</iconset>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="4" column="1">
|
||||||
<widget class="QLineEdit" name="txtCppCompiler"/>
|
<widget class="QLineEdit" name="txtGDBServer"/>
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QLabel" name="label_5">
|
|
||||||
<property name="text">
|
|
||||||
<string>gdb</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="2">
|
|
||||||
<widget class="QToolButton" name="btnChooseResourceCompiler">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Choose Resource Compiler</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>...</string>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset>
|
|
||||||
<normalon>:/icons/images/newlook24/053-open.png</normalon>
|
|
||||||
</iconset>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QLineEdit" name="txtCCompiler"/>
|
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QLabel" name="label_8">
|
<widget class="QLabel" name="label_8">
|
||||||
|
@ -399,6 +368,44 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLineEdit" name="txtCCompiler"/>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>C Compiler(gcc)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLineEdit" name="txtCppCompiler"/>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="2">
|
||||||
|
<widget class="QToolButton" name="btnChooseMake">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Choose make</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<normalon>:/icons/images/newlook24/053-open.png</normalon>
|
||||||
|
</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="0">
|
||||||
|
<widget class="QLabel" name="label_7">
|
||||||
|
<property name="text">
|
||||||
|
<string>Profiler(gprof)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QLineEdit" name="txtMake"/>
|
||||||
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QLabel" name="label_6">
|
<widget class="QLabel" name="label_6">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -406,11 +413,25 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item row="3" column="0">
|
||||||
<widget class="QLineEdit" name="txtGDBServer"/>
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="text">
|
||||||
|
<string>gdb</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="2">
|
<item row="6" column="0">
|
||||||
<widget class="QToolButton" name="btnChooseGDBServer">
|
<widget class="QLabel" name="label_9">
|
||||||
|
<property name="text">
|
||||||
|
<string>Assembler</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="1">
|
||||||
|
<widget class="QLineEdit" name="txtAssembler"/>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="2">
|
||||||
|
<widget class="QToolButton" name="btnChooseAssembler">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>...</string>
|
<string>...</string>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#define APP_SETTSINGS_FILENAME "redpandacpp.ini"
|
#define APP_SETTSINGS_FILENAME "redpandacpp.ini"
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
#define CONSOLE_PAUSER "consolepauser.exe"
|
#define CONSOLE_PAUSER "consolepauser.exe"
|
||||||
|
#define ASSEMBLER "nasm.exe"
|
||||||
#define GCC_PROGRAM "gcc.exe"
|
#define GCC_PROGRAM "gcc.exe"
|
||||||
#define GPP_PROGRAM "g++.exe"
|
#define GPP_PROGRAM "g++.exe"
|
||||||
#define GDB_PROGRAM "gdb.exe"
|
#define GDB_PROGRAM "gdb.exe"
|
||||||
|
@ -39,6 +40,7 @@
|
||||||
#define LLDB_SERVER_PROGRAM "lldb-server.exe"
|
#define LLDB_SERVER_PROGRAM "lldb-server.exe"
|
||||||
#elif defined(Q_OS_LINUX)
|
#elif defined(Q_OS_LINUX)
|
||||||
#define CONSOLE_PAUSER "consolepauser"
|
#define CONSOLE_PAUSER "consolepauser"
|
||||||
|
#define ASSEMBLER "nasm"
|
||||||
#define GCC_PROGRAM "gcc"
|
#define GCC_PROGRAM "gcc"
|
||||||
#define GPP_PROGRAM "g++"
|
#define GPP_PROGRAM "g++"
|
||||||
#define GDB_PROGRAM "gdb"
|
#define GDB_PROGRAM "gdb"
|
||||||
|
@ -55,6 +57,7 @@
|
||||||
#define LLDB_MI_PROGRAM "lldb-mi"
|
#define LLDB_MI_PROGRAM "lldb-mi"
|
||||||
#define LLDB_SERVER_PROGRAM "lldb-server"
|
#define LLDB_SERVER_PROGRAM "lldb-server"
|
||||||
#elif defined(Q_OS_MACOS)
|
#elif defined(Q_OS_MACOS)
|
||||||
|
#define ASSEMBLER "nasm"
|
||||||
#define GCC_PROGRAM "gcc"
|
#define GCC_PROGRAM "gcc"
|
||||||
#define GPP_PROGRAM "g++"
|
#define GPP_PROGRAM "g++"
|
||||||
#define GDB_PROGRAM "gdb"
|
#define GDB_PROGRAM "gdb"
|
||||||
|
|
|
@ -83,6 +83,9 @@ QStringList splitProcessCommand(const QString &cmd)
|
||||||
|
|
||||||
FileType getFileType(const QString &filename)
|
FileType getFileType(const QString &filename)
|
||||||
{
|
{
|
||||||
|
if (filename.endsWith(".asm",PATH_SENSITIVITY)) {
|
||||||
|
return FileType::ASM;
|
||||||
|
}
|
||||||
if (filename.endsWith(".dev",PATH_SENSITIVITY)) {
|
if (filename.endsWith(".dev",PATH_SENSITIVITY)) {
|
||||||
return FileType::Project;
|
return FileType::Project;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,7 @@ using SimpleIni = CSimpleIniA;
|
||||||
using PSimpleIni = std::shared_ptr<SimpleIni>;
|
using PSimpleIni = std::shared_ptr<SimpleIni>;
|
||||||
|
|
||||||
enum class FileType{
|
enum class FileType{
|
||||||
|
ASM, // asm source file (.asm)
|
||||||
CSource, // c source file (.c)
|
CSource, // c source file (.c)
|
||||||
CppSource, // c++ source file (.cpp)
|
CppSource, // c++ source file (.cpp)
|
||||||
CHeader, // c header (.h)
|
CHeader, // c header (.h)
|
||||||
|
|
Loading…
Reference in New Issue