- fix: Can't compile files with chinese characters in filenames using winlibs mingw gcc
This commit is contained in:
parent
d484c790a2
commit
08fdeca219
1
NEWS.md
1
NEWS.md
|
@ -16,6 +16,7 @@ Red Panda C++ Version 2.12
|
||||||
- enhancement: New GAS File in the File Menu
|
- enhancement: New GAS File in the File Menu
|
||||||
- change: rename "New File" to "New C/C++ File"
|
- change: rename "New File" to "New C/C++ File"
|
||||||
- change: The default disassemble style of CPU Dialog is "AT&T" now.
|
- change: The default disassemble style of CPU Dialog is "AT&T" now.
|
||||||
|
- fix: Can't compile files with chinese characters in filenames using winlibs mingw gcc
|
||||||
|
|
||||||
Red Panda C++ Version 2.11
|
Red Panda C++ Version 2.11
|
||||||
|
|
||||||
|
|
|
@ -665,7 +665,7 @@ void Compiler::runCommand(const QString &cmd, const QString &arguments, const Q
|
||||||
}
|
}
|
||||||
env.insert("PATH",path);
|
env.insert("PATH",path);
|
||||||
}
|
}
|
||||||
env.insert("LANG","en");
|
//env.insert("LANG","en");
|
||||||
env.insert("LDFLAGS","-Wl,--stack,12582912");
|
env.insert("LDFLAGS","-Wl,--stack,12582912");
|
||||||
env.insert("CFLAGS","");
|
env.insert("CFLAGS","");
|
||||||
env.insert("CXXFLAGS","");
|
env.insert("CXXFLAGS","");
|
||||||
|
|
|
@ -55,9 +55,9 @@ void ProjectCompiler::createStandardMakeFile()
|
||||||
file.write("$(BIN): $(OBJ)\n");
|
file.write("$(BIN): $(OBJ)\n");
|
||||||
if (!mOnlyCheckSyntax) {
|
if (!mOnlyCheckSyntax) {
|
||||||
if (mProject->options().isCpp) {
|
if (mProject->options().isCpp) {
|
||||||
writeln(file,"\t$(CPP) $(LINKOBJ) -o $(BIN) $(LIBS)");
|
writeln(file,"\t$(CPP) $(LINKOBJ) -o \"$(BIN)\" $(LIBS)");
|
||||||
} else
|
} else
|
||||||
writeln(file,"\t$(CC) $(LINKOBJ) -o $(BIN) $(LIBS)");
|
writeln(file,"\t$(CC) $(LINKOBJ) -o \"$(BIN)\" $(LIBS)");
|
||||||
}
|
}
|
||||||
writeMakeObjFilesRules(file);
|
writeMakeObjFilesRules(file);
|
||||||
}
|
}
|
||||||
|
@ -81,9 +81,9 @@ void ProjectCompiler::createDynamicMakeFile()
|
||||||
writeln(file,"$(BIN): $(LINKOBJ)");
|
writeln(file,"$(BIN): $(LINKOBJ)");
|
||||||
if (!mOnlyCheckSyntax) {
|
if (!mOnlyCheckSyntax) {
|
||||||
if (mProject->options().isCpp) {
|
if (mProject->options().isCpp) {
|
||||||
writeln(file, "\t$(CPP) -mdll $(LINKOBJ) -o $(BIN) $(LIBS) -Wl,--output-def,$(DEF),--out-implib,$(STATIC)");
|
writeln(file, "\t$(CPP) -mdll $(LINKOBJ) -o \"$(BIN)\" $(LIBS) -Wl,--output-def,$(DEF),--out-implib,$(STATIC)");
|
||||||
} else {
|
} else {
|
||||||
writeln(file, "\t$(CC) -mdll $(LINKOBJ) -o $(BIN) $(LIBS) -Wl,--output-def,$(DEF),--out-implib,$(STATIC)");
|
writeln(file, "\t$(CC) -mdll $(LINKOBJ) -o \"$(BIN)\" $(LIBS) -Wl,--output-def,$(DEF),--out-implib,$(STATIC)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
writeMakeObjFilesRules(file);
|
writeMakeObjFilesRules(file);
|
||||||
|
@ -494,17 +494,17 @@ void ProjectCompiler::writeMakeObjFilesRules(QFile &file)
|
||||||
writeln(file, "\t(CC) -c " + genMakePath1(shortFileName) + " $(CFLAGS) " + encodingStr);
|
writeln(file, "\t(CC) -c " + genMakePath1(shortFileName) + " $(CFLAGS) " + encodingStr);
|
||||||
} else {
|
} else {
|
||||||
if (unit->compileCpp())
|
if (unit->compileCpp())
|
||||||
writeln(file, "\t$(CPP) -c " + genMakePath1(shortFileName) + " -o " + objFileName2 + " $(CXXFLAGS) " + encodingStr);
|
writeln(file, "\t$(CPP) -c " + genMakePath1(shortFileName) + " -o \"" + objFileName2 + "\" $(CXXFLAGS) " + encodingStr);
|
||||||
else
|
else
|
||||||
writeln(file, "\t$(CC) -c " + genMakePath1(shortFileName) + " -o " + objFileName2 + " $(CFLAGS) " + encodingStr);
|
writeln(file, "\t$(CC) -c " + genMakePath1(shortFileName) + " -o \"" + objFileName2 + "\" $(CFLAGS) " + encodingStr);
|
||||||
}
|
}
|
||||||
} else if (fileType==FileType::GAS) {
|
} else if (fileType==FileType::GAS) {
|
||||||
if (!mOnlyCheckSyntax) {
|
if (!mOnlyCheckSyntax) {
|
||||||
writeln(file, "\t$(CC) -c " + genMakePath1(shortFileName) + " -o " + objFileName2 + " $(CFLAGS) " + encodingStr);
|
writeln(file, "\t$(CC) -c " + genMakePath1(shortFileName) + " -o \"" + objFileName2 + "\" $(CFLAGS) " + encodingStr);
|
||||||
}
|
}
|
||||||
} else if (fileType==FileType::ASM) {
|
} else if (fileType==FileType::ASM) {
|
||||||
if (!mOnlyCheckSyntax) {
|
if (!mOnlyCheckSyntax) {
|
||||||
writeln(file, "\t$(ASM) " + genMakePath1(shortFileName) + " -o " + objFileName2 + " $(ASMFLAGS) ");
|
writeln(file, "\t$(ASM) " + genMakePath1(shortFileName) + " -o \"" + objFileName2 + "\" $(ASMFLAGS) ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -561,7 +561,7 @@ void ProjectCompiler::writeMakeObjFilesRules(QFile &file)
|
||||||
} else {
|
} else {
|
||||||
writeln(file);
|
writeln(file);
|
||||||
writeln(file, objFileName2 + ": " + privResName2 + ' ' + resFiles);
|
writeln(file, objFileName2 + ": " + privResName2 + ' ' + resFiles);
|
||||||
writeln(file, "\t$(WINDRES) -i " + privResName + windresArgs + " --input-format=rc -o " + objFileName + " -O coff $(WINDRESFLAGS)"
|
writeln(file, "\t$(WINDRES) -i " + privResName + windresArgs + " --input-format=rc -o \"" + objFileName + "\" -O coff $(WINDRESFLAGS)"
|
||||||
+ ResIncludes);
|
+ ResIncludes);
|
||||||
}
|
}
|
||||||
writeln(file);
|
writeln(file);
|
||||||
|
|
|
@ -3021,16 +3021,6 @@ void MainWindow::onBookmarkContextMenu(const QPoint &pos)
|
||||||
bool MainWindow::saveLastOpens()
|
bool MainWindow::saveLastOpens()
|
||||||
{
|
{
|
||||||
QString filename = includeTrailingPathDelimiter(pSettings->dirs().config()) + DEV_LASTOPENS_FILE;
|
QString filename = includeTrailingPathDelimiter(pSettings->dirs().config()) + DEV_LASTOPENS_FILE;
|
||||||
QFile file(filename);
|
|
||||||
|
|
||||||
if (!file.open(QFile::WriteOnly | QFile::Truncate)) {
|
|
||||||
QMessageBox::critical(this,
|
|
||||||
tr("Save last open info error"),
|
|
||||||
tr("Can't open last open information file '%1' for write!")
|
|
||||||
.arg(filename),
|
|
||||||
QMessageBox::Ok);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
QJsonObject rootObj;
|
QJsonObject rootObj;
|
||||||
if (mProject) {
|
if (mProject) {
|
||||||
rootObj["lastProject"]=mProject->filename();
|
rootObj["lastProject"]=mProject->filename();
|
||||||
|
@ -3071,6 +3061,16 @@ bool MainWindow::saveLastOpens()
|
||||||
QJsonDocument doc;
|
QJsonDocument doc;
|
||||||
doc.setObject(rootObj);
|
doc.setObject(rootObj);
|
||||||
QByteArray json = doc.toJson();
|
QByteArray json = doc.toJson();
|
||||||
|
QFile file(filename);
|
||||||
|
|
||||||
|
if (!file.open(QFile::WriteOnly | QFile::Truncate)) {
|
||||||
|
QMessageBox::critical(this,
|
||||||
|
tr("Save last open info error"),
|
||||||
|
tr("Can't open last open information file '%1' for write!")
|
||||||
|
.arg(filename),
|
||||||
|
QMessageBox::Ok);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (file.write(doc.toJson())!=json.count()) {
|
if (file.write(doc.toJson())!=json.count()) {
|
||||||
QMessageBox::critical(this,
|
QMessageBox::critical(this,
|
||||||
tr("Save last open info error"),
|
tr("Save last open info error"),
|
||||||
|
|
Loading…
Reference in New Issue