本文整理汇总了C++中projectexplorer::ToolChain::addToEnvironment方法的典型用法代码示例。如果您正苦于以下问题:C++ ToolChain::addToEnvironment方法的具体用法?C++ ToolChain::addToEnvironment怎么用?C++ ToolChain::addToEnvironment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类projectexplorer::ToolChain
的用法示例。
在下文中一共展示了ToolChain::addToEnvironment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: availableTools
DebuggingHelperBuildTask::DebuggingHelperBuildTask(const BaseQtVersion *version, Tools tools) :
m_tools(tools & availableTools(version)),
m_invalidQt(false),
m_showErrors(true)
{
if (!version || !version->isValid())
return;
// allow type to be used in queued connections.
qRegisterMetaType<DebuggingHelperBuildTask::Tools>("DebuggingHelperBuildTask::Tools");
// Print result in application ouptut
Core::MessageManager *messageManager = Core::MessageManager::instance();
connect(this, SIGNAL(logOutput(QString,bool)),
messageManager, SLOT(printToOutputPane(QString,bool)),
Qt::QueuedConnection);
//
// Extract all information we need from version, such that we don't depend on the existence
// of the version pointer while compiling
//
m_qtId = version->uniqueId();
m_qtInstallData = version->versionInfo().value("QT_INSTALL_DATA");
if (m_qtInstallData.isEmpty()) {
const QString error
= QCoreApplication::translate(
"QtVersion",
"Cannot determine the installation path for Qt version '%1'."
).arg(version->displayName());
log(QString(), error);
m_invalidQt = true;
return;
}
m_environment = Utils::Environment::systemEnvironment();
version->addToEnvironment(m_environment);
// TODO: the debugging helper doesn't comply to actual tool chain yet
QList<ProjectExplorer::ToolChain *> tcList = ProjectExplorer::ToolChainManager::instance()->findToolChains(version->qtAbis().at(0));
if (tcList.isEmpty()) {
const QString error
= QCoreApplication::translate(
"QtVersion",
"The Qt Version has no tool chain.");
log(QString(), error);
m_invalidQt = true;
return;
}
ProjectExplorer::ToolChain *tc = tcList.at(0);
tc->addToEnvironment(m_environment);
if (tc->targetAbi().os() == ProjectExplorer::Abi::LinuxOS
&& ProjectExplorer::Abi::hostAbi().os() == ProjectExplorer::Abi::WindowsOS)
m_target = QLatin1String("-unix");
m_qmakeCommand = version->qmakeCommand();
m_makeCommand = tc->makeCommand();
m_mkspec = version->mkspec();
// Make sure QtVersion cache is invalidated
connect(this, SIGNAL(finished(int,QString,DebuggingHelperBuildTask::Tools)),
QtVersionManager::instance(), SLOT(updateQtVersion(int)),
Qt::QueuedConnection);
}