ToolChain: Create toolchains for different languages

Enable creation of toolchains for different languages and wire
up the logic in the ToolChain Options Page.

Change-Id: I9fbd95607d30cc1aa10f73d6532338f07f3e2b4e
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2016-07-12 15:08:53 +02:00
parent c071f68942
commit ce9ca1f0ef
9 changed files with 53 additions and 40 deletions

View File

@@ -88,10 +88,14 @@ static const char messageCapKeyC[] = "ProjectExplorer.CustomToolChain.MessageCap
CustomToolChain::CustomToolChain(Detection d) :
ToolChain(Constants::CUSTOM_TOOLCHAIN_TYPEID, d),
m_outputParser(Gcc)
{ }
CustomToolChain::CustomToolChain(Language l, Detection d) : CustomToolChain(d)
{
setLanguage(Language::Cxx);
setLanguage(l);
}
QString CustomToolChain::typeDisplayName() const
{
return Internal::CustomToolChainFactory::tr("Custom");
@@ -434,7 +438,7 @@ CustomToolChainFactory::CustomToolChainFactory()
QSet<ToolChain::Language> CustomToolChainFactory::supportedLanguages() const
{
return { ToolChain::Language::Cxx };
return ToolChain::allLanguages();
}
bool CustomToolChainFactory::canCreate()
@@ -442,9 +446,9 @@ bool CustomToolChainFactory::canCreate()
return true;
}
ToolChain *CustomToolChainFactory::create()
ToolChain *CustomToolChainFactory::create(ToolChain::Language l)
{
return new CustomToolChain(ToolChain::ManualDetection);
return new CustomToolChain(l, ToolChain::ManualDetection);
}
// Used by the ToolChainManager to restore user-generated tool chains