void GccToolChain::addToEnvironment(Utils::Environment &env) const { if (!m_compilerCommand.isEmpty()) { Utils::FileName path = m_compilerCommand.parentDir(); env.prependOrSetPath(path.toString()); } }
void GenericBuildConfiguration::addToEnvironment(Utils::Environment &env) const { prependCompilerPathToEnvironment(env); const QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(target()->kit()); if (qt) env.prependOrSetPath(qt->binPath().toString()); }
void MaemoQtVersion::addToEnvironment(Utils::Environment &env) const { const QString maddeRoot = MaemoGlobal::maddeRoot(qmakeCommand()); // Needed to make pkg-config stuff work. env.prependOrSet(QLatin1String("SYSROOT_DIR"), QDir::toNativeSeparators(systemRoot())); env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/madbin") .arg(maddeRoot))); env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/madlib") .arg(maddeRoot))); env.prependOrSet(QLatin1String("PERL5LIB"), QDir::toNativeSeparators(QString("%1/madlib/perl5").arg(maddeRoot))); env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/bin").arg(maddeRoot))); env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/bin") .arg(MaemoGlobal::targetRoot(qmakeCommand())))); }
void BuildConfiguration::prependCompilerPathToEnvironment(Kit *k, Utils::Environment &env) { const ToolChain *tc = ToolChainKitAspect::toolChain(k, ProjectExplorer::Constants::CXX_LANGUAGE_ID); if (!tc) return; const Utils::FileName compilerDir = tc->compilerCommand().parentDir(); if (!compilerDir.isEmpty()) env.prependOrSetPath(compilerDir.toString()); }
void SymbianQtVersion::addToEnvironment(const ProjectExplorer::Profile *p, Utils::Environment &env) const { BaseQtVersion::addToEnvironment(p, env); // Generic Symbian environment: QString epocRootPath = ProjectExplorer::SysRootProfileInformation::sysRoot(p).toString(); QDir epocDir(epocRootPath); // Clean up epoc root path for the environment: if (!epocRootPath.endsWith(QLatin1Char('/'))) epocRootPath.append(QLatin1Char('/')); if (!isBuildWithSymbianSbsV2()) { #ifdef Q_OS_WIN if (epocRootPath.count() > 2 && epocRootPath.at(0).toLower() >= QLatin1Char('a') && epocRootPath.at(0).toLower() <= QLatin1Char('z') && epocRootPath.at(1) == QLatin1Char(':')) { epocRootPath = epocRootPath.mid(2); } #endif } env.set(QLatin1String("EPOCROOT"), QDir::toNativeSeparators(epocRootPath)); env.prependOrSetPath(epocDir.filePath(QLatin1String("epoc32/tools"))); // e.g. make.exe // Windows only: if (ProjectExplorer::Abi::hostAbi().os() == ProjectExplorer::Abi::WindowsOS) { QString winDir = QLatin1String(qgetenv("WINDIR")); if (!winDir.isEmpty()) env.prependOrSetPath(QDir(winDir).filePath(QLatin1String("system32"))); if (epocDir.exists(QLatin1String("epoc32/gcc/bin"))) env.prependOrSetPath(epocDir.filePath(QLatin1String("epoc32/gcc/bin"))); // e.g. cpp.exe, *NOT* gcc.exe // Find perl in the special Symbian flavour: if (epocDir.exists(QLatin1String("../../tools/perl/bin"))) { epocDir.cd(QLatin1String("../../tools/perl/bin")); env.prependOrSetPath(epocDir.absolutePath()); } else { env.prependOrSetPath(epocDir.filePath(QLatin1String("perl/bin"))); } } // SBSv2: if (isBuildWithSymbianSbsV2()) { QString sbsHome(env.value(QLatin1String("SBS_HOME"))); QString sbsConfig = sbsV2Directory(); if (!sbsConfig.isEmpty()) { env.prependOrSetPath(sbsConfig); // SBS_HOME is the path minus the trailing /bin: env.set(QLatin1String("SBS_HOME"), QDir::toNativeSeparators(sbsConfig.left(sbsConfig.count() - 4))); // We need this for Qt 4.6.3 compatibility } else if (!sbsHome.isEmpty()) { env.prependOrSetPath(sbsHome + QLatin1String("/bin")); } } }
void RvctToolChain::addToEnvironment(Utils::Environment &env) const { if (m_compilerPath.isEmpty()) return; if (m_version.isNull()) setVersion(version(m_compilerPath)); 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)); env.set(varName(QLatin1String("BIN")), QDir::toNativeSeparators(QFileInfo(m_compilerPath).absolutePath())); // Add rvct to path and set locale to 'C' if (!m_compilerPath.isEmpty()) env.prependOrSetPath(QFileInfo(m_compilerPath).absolutePath()); env.set(QLatin1String("LANG"), QString(QLatin1Char('C'))); }
void QnxAbstractQtVersion::addToEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const { QtSupport::BaseQtVersion::addToEnvironment(k, env); if (!m_environmentUpToDate) updateEnvironment(); QMultiMap<QString, QString>::const_iterator it; QMultiMap<QString, QString>::const_iterator end(m_envMap.constEnd()); for (it = m_envMap.constBegin(); it != end; ++it) { const QString key = it.key(); const QString value = it.value(); if (key == QLatin1String("PATH")) env.prependOrSetPath(value); else if (key == QLatin1String("LD_LIBRARY_PATH")) env.prependOrSetLibrarySearchPath(value); else env.set(key, value); } env.prependOrSetLibrarySearchPath(versionInfo().value(QLatin1String("QT_INSTALL_LIBS"))); }
void ClangClToolChain::addToEnvironment(Utils::Environment &env) const { MsvcToolChain::addToEnvironment(env); env.prependOrSetPath(m_llvmDir + QStringLiteral("/bin")); }
void GccToolChain::addToEnvironment(Utils::Environment &env) const { if (!m_compilerPath.isEmpty()) env.prependOrSetPath(QFileInfo(m_compilerPath).absolutePath()); }