本文整理汇总了C++中utils::Environment::prependOrSetPath方法的典型用法代码示例。如果您正苦于以下问题:C++ Environment::prependOrSetPath方法的具体用法?C++ Environment::prependOrSetPath怎么用?C++ Environment::prependOrSetPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utils::Environment
的用法示例。
在下文中一共展示了Environment::prependOrSetPath方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addToEnvironment
void GccToolChain::addToEnvironment(Utils::Environment &env) const
{
if (!m_compilerCommand.isEmpty()) {
Utils::FileName path = m_compilerCommand.parentDir();
env.prependOrSetPath(path.toString());
}
}
示例2: addToEnvironment
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());
}
示例3: prependCompilerPathToEnvironment
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());
}
示例4: addToEnvironment
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"));
}
}
}
示例5: addToEnvironment
void ClangClToolChain::addToEnvironment(Utils::Environment &env) const
{
MsvcToolChain::addToEnvironment(env);
env.prependOrSetPath(m_llvmDir + QStringLiteral("/bin"));
}
示例6: addToEnvironment
void GccToolChain::addToEnvironment(Utils::Environment &env) const
{
if (!m_compilerPath.isEmpty())
env.prependOrSetPath(QFileInfo(m_compilerPath).absolutePath());
}