- fix: use utf8 as the encoding for clang's error output

This commit is contained in:
Roy Qu 2022-04-27 15:26:13 +08:00
parent 2459bee049
commit 945ba4ce73
4 changed files with 16 additions and 6 deletions

View File

@ -6,6 +6,7 @@ Red Panda C++ Version 1.0.6
- fix: c file should use CC to build in the auto generated makefile
- enhancement: package script for msys2 clang
- enhancement: auto set problem case's expected output file which has "ans" as the suffix, when batch set cases
- fix: use utf8 as the encoding for clang's error output
Red Panda C++ Version 1.0.5
- enhancement: add autolink and project template for sqlite3

View File

@ -590,10 +590,16 @@ void Compiler::runCommand(const QString &cmd, const QString &arguments, const Q
errorOccurred= true;
});
process.connect(&process, &QProcess::readyReadStandardError,[&process,this](){
this->error(QString::fromLocal8Bit( process.readAllStandardError()));
if (compilerSet()->compilerType() == COMPILER_CLANG)
this->error(QString::fromUtf8(process.readAllStandardError()));
else
this->error(QString::fromLocal8Bit( process.readAllStandardError()));
});
process.connect(&process, &QProcess::readyReadStandardOutput,[&process,this](){
this->log(QString::fromLocal8Bit( process.readAllStandardOutput()));
if (compilerSet()->compilerType() == COMPILER_CLANG)
this->log(QString::fromUtf8(process.readAllStandardOutput()));
else
this->log(QString::fromLocal8Bit( process.readAllStandardOutput()));
});
process.connect(&process, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),[this](){
this->error(COMPILE_PROCESS_END);

View File

@ -2066,10 +2066,10 @@ void Settings::CompilerSet::setExecutables()
mCCompiler = findProgramInBinDirs(GCC_PROGRAM);
if (mCppCompiler.isEmpty())
mCppCompiler = findProgramInBinDirs(GPP_PROGRAM);
if (mDebugger.isEmpty())
mDebugger = findProgramInBinDirs(GDB_PROGRAM);
if (mDebugServer.isEmpty())
mDebugServer = findProgramInBinDirs(GDB_SERVER_PROGRAM);
// if (mDebugger.isEmpty())
// mDebugger = findProgramInBinDirs(GDB_PROGRAM);
// if (mDebugServer.isEmpty())
// mDebugServer = findProgramInBinDirs(GDB_SERVER_PROGRAM);
} else {
mCCompiler = findProgramInBinDirs(GCC_PROGRAM);
mCppCompiler = findProgramInBinDirs(GPP_PROGRAM);

View File

@ -40,6 +40,9 @@ rm -rf lib/libclang*.a
rm -rf lib/libLLVM*.a
rm -rf lib/libtcl*.a
rm -rf lib/libtk*.a
rm -rf lib/liblldELF.a
rm -rf lib/liblldCOFF.a
rm -rf lib/liblldMachO.a
rm -rf lib/libtdbc*
rm -rf lib/tcl8
rm -rf lib/tcl8.6