QList<ProjectExplorer::ToolChain *> CrossLinuxToolChain32BitFactory::autoDetectToolChains( const QString &displayName, const QString &commandPath, const QStringList &debuggers, const ProjectExplorer::Abi &requiredAbi) { //TODO add debuger options Q_UNUSED(debuggers); QList<ProjectExplorer::ToolChain *> result; CrossToolChain32Bit *tc = static_cast<CrossToolChain32Bit *>(createToolChain(true)); QDir sdkDir =CrossSDKInfo::instance().sdkRoot(); Utils::FileName tcCommand; QString sdkPath; sdkPath = sdkDir.canonicalPath(); tcCommand.append(sdkPath + commandPath); if (!tcCommand.toFileInfo().exists()) { return result; } tc->setDisplayName(displayName); tc->setCompilerCommand(tcCommand); tc->setTargetAbi(requiredAbi); result.append(tc); return result; }
ToolChain *Internal::GccToolChainFactory::create() { return createToolChain(false); }
{ QList<ToolChain *> result; const Utils::Environment systemEnvironment = Utils::Environment::systemEnvironment(); const QString compilerPath = systemEnvironment.searchInPath(compiler); if (compilerPath.isEmpty()) return result; QString debuggerPath; // Find the first debugger foreach (const QString &debugger, debuggers) { debuggerPath = systemEnvironment.searchInPath(debugger); if (!debuggerPath.isEmpty()) break; } // Create 64bit QScopedPointer<GccToolChain> tc(createToolChain(true)); if (tc.isNull()) return result; tc->setCompilerPath(compilerPath); tc->setDebuggerCommand(debuggerPath); const ProjectExplorer::Abi abi = tc->targetAbi(); if (abi.isValid() && abi == requiredAbi) result.append(tc.take()); if (abi.wordWidth() != 64) return result; // Create 32bit tc.reset(createToolChain(true)); QTC_ASSERT(!tc.isNull(), return result; ); // worked once, so should work again:-)