bool AndroidToolChain::fromMap(const QVariantMap &data) { if (!GccToolChain::fromMap(data)) return false; if (data.contains(QLatin1String(ANDROID_QT_VERSION_KEY))) { QString command = compilerCommand().toString(); QString ndkPath = AndroidConfigurations::currentConfig().ndkLocation().toString(); if (!command.startsWith(ndkPath)) return false; command = command.mid(ndkPath.length()); if (!command.startsWith(QLatin1String("/toolchains/"))) return false; command = command.mid(12); int index = command.indexOf(QLatin1Char('/')); if (index == -1) return false; command = command.left(index); QRegExp versionRegExp(NDKGccVersionRegExp); index = versionRegExp.indexIn(command); if (index == -1) return false; m_ndkToolChainVersion = command.mid(index + 1); QString platform = command.left(index); setTargetAbi(AndroidConfig::abiForToolChainPrefix(platform)); } else { m_ndkToolChainVersion = data.value(QLatin1String(ANDROID_NDK_TC_VERION)).toString(); } Abi abi = targetAbi(); m_secondaryToolChain = AndroidToolChainFactory::versionCompareLess(AndroidToolChainFactory::versionNumberFromString(m_ndkToolChainVersion), AndroidToolChainFactory::newestToolChainVersionForArch(abi)); return isValid(); }
bool CE::copyRunshTo(const QString &source, const QString &path, const QModelIndex &index) { assert(index.isValid()); QFile file(source); if(!file.open(QIODevice::ReadOnly)) return false; QString text = file.readAll(); text = text.arg(index.data(CE::ThreadNumRole).toString(),compilerCommand("$sds",index)); QFile out(path); if(!out.open(QIODevice::WriteOnly|QIODevice::Truncate) ) return false; return out.write(text.toLocal8Bit()) != -1; }
bool CE::copyBatTo(const QString &source, const QString &path, const QModelIndex &index) { assert(index.isValid()); QFile file(source); if(!file.open(QIODevice::ReadOnly)) return false; QString text = file.readAll(); text.replace("set cores=%cores%","set cores="+index.data(CE::ThreadNumRole).toString().trimmed()); text.replace("echo %sds%",compilerCommand("%sds%",index)); QFile out(path); if(!out.open(QIODevice::WriteOnly|QIODevice::Truncate) ) return false; return out.write(text.toLocal8Bit()) != -1; }
void RvctToolChain::addToEnvironment(Utils::Environment &env) const { if (m_compilerCommand.isEmpty()) return; if (m_version.isNull()) setVersion(version(m_compilerCommand)); if (m_version.isNull()) return; env.modify(m_environmentChanges); env.set(QLatin1String("QT_RVCT_VERSION"), QString::fromLatin1("%1.%2") .arg(m_version.majorVersion).arg(m_version.minorVersion)); const QString cxxPath = compilerCommand().toFileInfo().absolutePath(); env.set(varName(QLatin1String("BIN")), QDir::toNativeSeparators(cxxPath)); // Add rvct to path and set locale to 'C' if (!m_compilerCommand.isEmpty()) env.prependOrSetPath(cxxPath); env.set(QLatin1String("LANG"), QString(QLatin1Char('C'))); }