- fix: Mingw32-make doesn't work correctly if there are bash in the path.

This commit is contained in:
Roy Qu 2024-05-28 17:12:31 +08:00
parent 87bbb23fa2
commit 7aa85611e3
2 changed files with 11 additions and 0 deletions

View File

@ -12,6 +12,7 @@ Red Panda C++ Version 3.1
- enhancement: When problems info from competitive-companion received, show tips in the status bar. - enhancement: When problems info from competitive-companion received, show tips in the status bar.
- fix: Layout for function tips. - fix: Layout for function tips.
- enhancement: More elements in the demo of editor color theme optiont page. - enhancement: More elements in the demo of editor color theme optiont page.
- fix: Mingw32-make doesn't work correctly if there are bash in the path.
Red Panda C++ Version 3.0 Red Panda C++ Version 3.0

View File

@ -713,6 +713,15 @@ void Compiler::runCommand(const QString &cmd, const QStringList &arguments, cons
bool compilerErrorUTF8=compilerSet()->isCompilerInfoUsingUTF8(); bool compilerErrorUTF8=compilerSet()->isCompilerInfoUsingUTF8();
bool outputUTF8=compilerSet()->forceUTF8(); bool outputUTF8=compilerSet()->forceUTF8();
QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
#ifdef Q_OS_WIN
QStringList binDirs=compilerSet()->binDirs();
if (!cmdDir.isEmpty())
binDirs.insert(0, cmdDir);
QString windir = env.value("windir");
binDirs.append(windir+"\\system32");
binDirs.append(windir);
env.insert("PATH",binDirs.join(PATH_SEPARATOR));
#else
if (!cmdDir.isEmpty()) { if (!cmdDir.isEmpty()) {
QString path = env.value("PATH"); QString path = env.value("PATH");
if (path.isEmpty()) { if (path.isEmpty()) {
@ -722,6 +731,7 @@ void Compiler::runCommand(const QString &cmd, const QStringList &arguments, cons
} }
env.insert("PATH",path); env.insert("PATH",path);
} }
#endif
if (compilerSet() && compilerSet()->forceEnglishOutput()) if (compilerSet() && compilerSet()->forceEnglishOutput())
env.insert("LANG","en"); env.insert("LANG","en");
//env.insert("LDFLAGS","-Wl,--stack,12582912"); //env.insert("LDFLAGS","-Wl,--stack,12582912");