- 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: 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.
- fix: c files added to a project will be compiled as c++ file.
Red Panda C++ Version 1.0.10
- fix: modify watch doesn't work

View File

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

View File

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