fix: auto find compilers failed.

This commit is contained in:
Roy Qu 2022-12-16 16:36:59 +08:00
parent 0e5ff0a75e
commit 07f6b975f1
2 changed files with 7 additions and 7 deletions

View File

@ -1599,7 +1599,7 @@ Settings::CompilerSet::CompilerSet(const QString& compilerFolder, const QString&
QDir dir(compilerFolder);
if (dir.exists(c_prog)) {
setProperties(dir.absoluteFilePath(c_prog));
setProperties(compilerFolder,c_prog);
//manually set the directories
setDirectories(compilerFolder, mCompilerType);
@ -2092,15 +2092,15 @@ static void addExistingDirectory(QStringList& dirs, const QString& directory) {
dirs.append(dirPath);
}
void Settings::CompilerSet::setProperties(const QString& c_prog)
void Settings::CompilerSet::setProperties(const QString& binDir, const QString& c_prog)
{
if (!fileExists(c_prog))
return;
QString binDir=extractFileDir(c_prog);
// We have tested before the call
// if (!fileExists(c_prog))
// return;
// Obtain version number and compiler distro etc
QStringList arguments;
arguments.append("-v");
QByteArray output = getCompilerOutput(binDir,c_prog,arguments);
QByteArray output = getCompilerOutput(binDir, c_prog,arguments);
//Target
QByteArray targetStr = "Target: ";

View File

@ -1246,7 +1246,7 @@ public:
CompilerSet& operator= (const CompilerSet&& ) = delete;
// Initialization
void setProperties(const QString& c_prog);
void setProperties(const QString& binDir, const QString& c_prog);
void resetCompileOptionts();
bool setCompileOption(const QString& key, int valIndex);