- fix: c files added to a project will be compiled as c++ file.

This commit is contained in:
Roy Qu 2022-06-10 08:41:52 +08:00
parent 67e686652d
commit d01a60e88f
3 changed files with 21 additions and 6 deletions

View File

@ -2,6 +2,7 @@ Red Panda C++ Version 1.1.0
- enhancement: when ctrl+mouse cursor hovered an identifier or header name, use underline to highlight it - enhancement: when ctrl+mouse cursor hovered an identifier or header name, use underline to highlight it
- enhancement: mark editor as modified, if the editing file is changed by other applications. - enhancement: mark editor as modified, if the editing file is changed by other applications.
- enhancement: When the editing files is changed by other applications, only show one notification dialog for each file. - enhancement: When the editing files is changed by other applications, only show one notification dialog for each file.
- fix: c files added to a project will be compiled as c++ file.
Red Panda C++ Version 1.0.10 Red Panda C++ Version 1.0.10
- fix: modify watch doesn't work - fix: modify watch doesn't work

View File

@ -466,7 +466,7 @@ QString Compiler::getLibraryArguments(FileType fileType)
int waitCount = 0; int waitCount = 0;
//wait parsing ends, at most 1 second //wait parsing ends, at most 1 second
while(parser->parsing()) { while(parser->parsing()) {
if (waitCount>0) if (waitCount>10)
break; break;
waitCount++; waitCount++;
QThread::msleep(100); QThread::msleep(100);

View File

@ -278,13 +278,27 @@ PProjectUnit Project::newUnit(PProjectModelNode parentNode, const QString& custo
false, parentNode)); false, parentNode));
newUnit->node()->unitIndex = count; newUnit->node()->unitIndex = count;
//parentNode.Expand(True); //parentNode.Expand(True);
newUnit->setCompile(true); switch(getFileType(customFileName)) {
if (getFileType(customFileName) == FileType::CSource) { case FileType::CSource:
newUnit->setCompile(true);
newUnit->setCompileCpp(false); newUnit->setCompileCpp(false);
} else { newUnit->setLink(true);
break;
case FileType::CppSource:
newUnit->setCompile(true);
newUnit->setCompileCpp(true);
newUnit->setLink(true);
break;
case FileType::WindowsResourceSource:
newUnit->setCompile(true);
newUnit->setCompileCpp(mOptions.isCpp); newUnit->setCompileCpp(mOptions.isCpp);
newUnit->setLink(false);
break;
default:
newUnit->setCompile(false);
newUnit->setCompileCpp(false);
newUnit->setLink(false);
} }
newUnit->setLink(true);
newUnit->setPriority(1000); newUnit->setPriority(1000);
newUnit->setOverrideBuildCmd(false); newUnit->setOverrideBuildCmd(false);
newUnit->setBuildCmd(""); newUnit->setBuildCmd("");
@ -976,7 +990,7 @@ PProjectUnit Project::addUnit(const QString &inFileName, PProjectModelNode paren
switch(getFileType(inFileName)) { switch(getFileType(inFileName)) {
case FileType::CSource: case FileType::CSource:
newUnit->setCompile(true); newUnit->setCompile(true);
newUnit->setCompileCpp(mOptions.isCpp); newUnit->setCompileCpp(false);
newUnit->setLink(true); newUnit->setLink(true);
break; break;
case FileType::CppSource: case FileType::CppSource: