forked from qt-creator/qt-creator
ProjectExplorer: Provide a ToolChain::isValid() base implementation
It checks for an executable compilerCommand(). This was used in Gcc, Clang and Nim before. MSVC still overrides with a different test. The formerly unconditional 'return true' for Keil/IAR/Sdcc uses that check now, too. Change-Id: I433a5ac6784277dc77129b2671c28af6913327a7 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -296,11 +296,6 @@ IarToolChain::IarToolChain() :
|
||||
setCompilerCommandKey("CompilerPath");
|
||||
}
|
||||
|
||||
bool IarToolChain::isValid() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
ToolChain::MacroInspectionRunner IarToolChain::createMacroInspectionRunner() const
|
||||
{
|
||||
Environment env = Environment::systemEnvironment();
|
||||
|
@@ -53,8 +53,6 @@ class IarToolChain final : public ProjectExplorer::ToolChain
|
||||
Q_DECLARE_TR_FUNCTIONS(IarToolChain)
|
||||
|
||||
public:
|
||||
bool isValid() const final;
|
||||
|
||||
MacroInspectionRunner createMacroInspectionRunner() const final;
|
||||
|
||||
Utils::LanguageExtensions languageExtensions(const QStringList &cxxflags) const final;
|
||||
|
@@ -435,11 +435,6 @@ KeilToolChain::KeilToolChain() :
|
||||
setCompilerCommandKey("CompilerPath");
|
||||
}
|
||||
|
||||
bool KeilToolChain::isValid() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
ToolChain::MacroInspectionRunner KeilToolChain::createMacroInspectionRunner() const
|
||||
{
|
||||
Environment env = Environment::systemEnvironment();
|
||||
|
@@ -53,8 +53,6 @@ class KeilToolChain final : public ProjectExplorer::ToolChain
|
||||
Q_DECLARE_TR_FUNCTIONS(KeilToolChain)
|
||||
|
||||
public:
|
||||
bool isValid() const final;
|
||||
|
||||
MacroInspectionRunner createMacroInspectionRunner() const final;
|
||||
|
||||
Utils::LanguageExtensions languageExtensions(const QStringList &cxxflags) const final;
|
||||
|
@@ -219,11 +219,6 @@ SdccToolChain::SdccToolChain() :
|
||||
setCompilerCommandKey("CompilerPath");
|
||||
}
|
||||
|
||||
bool SdccToolChain::isValid() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
ToolChain::MacroInspectionRunner SdccToolChain::createMacroInspectionRunner() const
|
||||
{
|
||||
Environment env = Environment::systemEnvironment();
|
||||
|
@@ -52,8 +52,6 @@ class SdccToolChain final : public ProjectExplorer::ToolChain
|
||||
Q_DECLARE_TR_FUNCTIONS(SdccToolChain)
|
||||
|
||||
public:
|
||||
bool isValid() const final;
|
||||
|
||||
MacroInspectionRunner createMacroInspectionRunner() const final;
|
||||
|
||||
Utils::LanguageExtensions languageExtensions(const QStringList &cxxflags) const final;
|
||||
|
@@ -53,14 +53,6 @@ NimToolChain::NimToolChain(Utils::Id typeId)
|
||||
setCompilerCommandKey("Nim.NimToolChain.CompilerCommand");
|
||||
}
|
||||
|
||||
bool NimToolChain::isValid() const
|
||||
{
|
||||
if (compilerCommand().isEmpty())
|
||||
return false;
|
||||
QFileInfo fi = compilerCommand().toFileInfo();
|
||||
return fi.isExecutable();
|
||||
}
|
||||
|
||||
ToolChain::MacroInspectionRunner NimToolChain::createMacroInspectionRunner() const
|
||||
{
|
||||
return ToolChain::MacroInspectionRunner();
|
||||
|
@@ -38,8 +38,6 @@ public:
|
||||
NimToolChain();
|
||||
explicit NimToolChain(Utils::Id typeId);
|
||||
|
||||
bool isValid() const override;
|
||||
|
||||
MacroInspectionRunner createMacroInspectionRunner() const override;
|
||||
Utils::LanguageExtensions languageExtensions(const QStringList &flags) const final;
|
||||
Utils::WarningFlags warningFlags(const QStringList &flags) const final;
|
||||
|
@@ -344,15 +344,6 @@ Abis GccToolChain::supportedAbis() const
|
||||
return m_supportedAbis;
|
||||
}
|
||||
|
||||
bool GccToolChain::isValid() const
|
||||
{
|
||||
if (compilerCommand().isEmpty())
|
||||
return false;
|
||||
|
||||
QFileInfo fi = compilerCommand().toFileInfo();
|
||||
return fi.isExecutable();
|
||||
}
|
||||
|
||||
static bool isNetworkCompiler(const QString &dirPath)
|
||||
{
|
||||
return dirPath.contains("icecc") || dirPath.contains("distcc");
|
||||
|
@@ -75,7 +75,6 @@ public:
|
||||
Utils::FilePath installDir() const override;
|
||||
QString version() const;
|
||||
Abis supportedAbis() const override;
|
||||
bool isValid() const override;
|
||||
|
||||
Utils::LanguageExtensions languageExtensions(const QStringList &cxxflags) const override;
|
||||
Utils::WarningFlags warningFlags(const QStringList &cflags) const override;
|
||||
|
@@ -159,6 +159,14 @@ Abis ToolChain::supportedAbis() const
|
||||
return {targetAbi()};
|
||||
}
|
||||
|
||||
bool ToolChain::isValid() const
|
||||
{
|
||||
if (compilerCommand().isEmpty())
|
||||
return false;
|
||||
QFileInfo fi = compilerCommand().toFileInfo();
|
||||
return fi.isExecutable();
|
||||
}
|
||||
|
||||
QStringList ToolChain::includedFiles(const QStringList &flags, const QString &directory) const
|
||||
{
|
||||
Q_UNUSED(flags)
|
||||
|
@@ -103,7 +103,7 @@ public:
|
||||
virtual QStringList extraCodeModelFlags() const { return QStringList(); }
|
||||
virtual Utils::FilePath installDir() const { return Utils::FilePath(); }
|
||||
|
||||
virtual bool isValid() const = 0;
|
||||
virtual bool isValid() const;
|
||||
|
||||
virtual Utils::LanguageExtensions languageExtensions(const QStringList &cxxflags) const = 0;
|
||||
virtual Utils::WarningFlags warningFlags(const QStringList &cflags) const = 0;
|
||||
|
Reference in New Issue
Block a user