本文整理汇总了C++中projectexplorer::ToolChain::outputParser方法的典型用法代码示例。如果您正苦于以下问题:C++ ToolChain::outputParser方法的具体用法?C++ ToolChain::outputParser怎么用?C++ ToolChain::outputParser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类projectexplorer::ToolChain
的用法示例。
在下文中一共展示了ToolChain::outputParser方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: genericTarget
ProjectExplorer::IOutputParser *GenericBuildConfiguration::createOutputParser() const
{
ProjectExplorer::ToolChain *tc = genericTarget()->genericProject()->toolChain();
if (tc)
return tc->outputParser();
return 0;
}
示例2:
ProjectExplorer::IOutputParser *CMakeBuildConfiguration::createOutputParser() const
{
ProjectExplorer::IOutputParser *parserchain = new ProjectExplorer::GnuMakeParser;
int versionId = QtSupport::QtKitInformation::qtVersionId(target()->kit());
if (versionId >= 0)
parserchain->appendOutputParser(new QtSupport::QtParser);
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
if (tc)
parserchain->appendOutputParser(tc->outputParser());
return parserchain;
}
示例3: init
bool MakeStep::init()
{
Qt4BuildConfiguration *bc = qt4BuildConfiguration();
m_tasks.clear();
if (!bc->toolChain()) {
m_tasks.append(ProjectExplorer::Task(ProjectExplorer::Task::Error,
tr("Qt Creator needs a tool chain set up to build. Please configure a tool chain in Project mode."),
QString(), -1,
QLatin1String(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
}
ProjectExplorer::ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc->macroExpander());
Utils::Environment environment = bc->environment();
pp->setEnvironment(environment);
QString workingDirectory;
if (bc->subNodeBuild())
workingDirectory = bc->subNodeBuild()->buildDir();
else
workingDirectory = bc->buildDirectory();
pp->setWorkingDirectory(workingDirectory);
QString makeCmd = bc->makeCommand();
if (!m_makeCmd.isEmpty())
makeCmd = m_makeCmd;
pp->setCommand(makeCmd);
// If we are cleaning, then make can fail with a error code, but that doesn't mean
// we should stop the clean queue
// That is mostly so that rebuild works on a already clean project
setIgnoreReturnValue(m_clean);
QString args;
ProjectExplorer::ToolChain *toolchain = bc->toolChain();
if (bc->subNodeBuild()) {
QString makefile = bc->subNodeBuild()->makefile();
if(!makefile.isEmpty()) {
Utils::QtcProcess::addArg(&args, QLatin1String("-f"));
Utils::QtcProcess::addArg(&args, makefile);
m_makeFileToCheck = QDir(workingDirectory).filePath(makefile);
} else {
m_makeFileToCheck = QDir(workingDirectory).filePath("Makefile");
}
} else {
if (!bc->makefile().isEmpty()) {
Utils::QtcProcess::addArg(&args, QLatin1String("-f"));
Utils::QtcProcess::addArg(&args, bc->makefile());
m_makeFileToCheck = QDir(workingDirectory).filePath(bc->makefile());
} else {
m_makeFileToCheck = QDir(workingDirectory).filePath("Makefile");
}
}
Utils::QtcProcess::addArgs(&args, m_userArgs);
if (!isClean()) {
if (!bc->defaultMakeTarget().isEmpty())
Utils::QtcProcess::addArg(&args, bc->defaultMakeTarget());
}
// -w option enables "Enter"/"Leaving directory" messages, which we need for detecting the
// absolute file path
// FIXME doing this without the user having a way to override this is rather bad
// so we only do it for unix and if the user didn't override the make command
// but for now this is the least invasive change
if (toolchain
&& toolchain->targetAbi().binaryFormat() != ProjectExplorer::Abi::PEFormat
&& m_makeCmd.isEmpty())
Utils::QtcProcess::addArg(&args, QLatin1String("-w"));
setEnabled(true);
pp->setArguments(args);
ProjectExplorer::IOutputParser *parser = 0;
if (bc->qtVersion())
parser = bc->qtVersion()->createOutputParser();
if (parser)
parser->appendOutputParser(new QtSupport::QtParser);
else
parser = new QtSupport::QtParser;
if (toolchain)
parser->appendOutputParser(toolchain->outputParser());
parser->setWorkingDirectory(workingDirectory);
setOutputParser(parser);
return AbstractProcessStep::init();
}
示例4: init
//.........这里部分代码省略.........
// we should stop the clean queue
// That is mostly so that rebuild works on a already clean project
setIgnoreReturnValue(m_clean);
QString args;
Qt4ProjectManager::Qt4ProFileNode *subNode = bc->subNodeBuild();
if (subNode) {
QString makefile = subNode->makefile();
if (makefile.isEmpty())
makefile = QLatin1String("Makefile");
if (subNode->isDebugAndRelease()) {
if (bc->buildType() == Qt4BuildConfiguration::Debug)
makefile += QLatin1String(".Debug");
else
makefile += QLatin1String(".Release");
}
if (makefile != QLatin1String("Makefile")) {
Utils::QtcProcess::addArg(&args, QLatin1String("-f"));
Utils::QtcProcess::addArg(&args, makefile);
}
m_makeFileToCheck = QDir(workingDirectory).filePath(makefile);
} else {
if (!bc->makefile().isEmpty()) {
Utils::QtcProcess::addArg(&args, QLatin1String("-f"));
Utils::QtcProcess::addArg(&args, bc->makefile());
m_makeFileToCheck = QDir(workingDirectory).filePath(bc->makefile());
} else {
m_makeFileToCheck = QDir(workingDirectory).filePath(QLatin1String("Makefile"));
}
}
Utils::QtcProcess::addArgs(&args, m_userArgs);
if (!isClean()) {
if (!bc->defaultMakeTarget().isEmpty())
Utils::QtcProcess::addArg(&args, bc->defaultMakeTarget());
}
if (bc->fileNodeBuild() && subNode) {
QString objectsDir = subNode->objectsDirectory();
if (objectsDir.isEmpty()) {
objectsDir = subNode->buildDir(bc);
if (subNode->isDebugAndRelease()) {
if (bc->buildType() == Qt4BuildConfiguration::Debug)
objectsDir += QLatin1String("/debug");
else
objectsDir += QLatin1String("/release");
}
}
QString relObjectsDir = QDir(pp->workingDirectory()).relativeFilePath(objectsDir);
if (!relObjectsDir.isEmpty())
relObjectsDir += QLatin1Char('/');
QString objectFile = relObjectsDir +
QFileInfo(bc->fileNodeBuild()->path()).baseName() +
subNode->objectExtension();
Utils::QtcProcess::addArg(&args, objectFile);
}
Utils::Environment env = bc->environment();
// Force output to english for the parsers. Do this here and not in the toolchain's
// addToEnvironment() to not screw up the users run environment.
env.set(QLatin1String("LC_ALL"), QLatin1String("C"));
// -w option enables "Enter"/"Leaving directory" messages, which we need for detecting the
// absolute file path
// doing this without the user having a way to override this is rather bad
// so we only do it for unix and if the user didn't override the make command
// but for now this is the least invasive change
// We also prepend "L" to the MAKEFLAGS, so that nmake / jom are less verbose
if (tc && m_makeCmd.isEmpty()) {
if (tc->targetAbi().binaryFormat() != ProjectExplorer::Abi::PEFormat )
Utils::QtcProcess::addArg(&args, QLatin1String("-w"));
if (tc->targetAbi().os() == ProjectExplorer::Abi::WindowsOS
&& tc->targetAbi().osFlavor() != ProjectExplorer::Abi::WindowsMSysFlavor) {
const QString makeFlags = QLatin1String("MAKEFLAGS");
env.set(makeFlags, QLatin1Char('L') + env.value(makeFlags));
}
}
pp->setEnvironment(env);
pp->setArguments(args);
ProjectExplorer::IOutputParser *parser = 0;
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target()->profile());
if (version)
parser = version->createOutputParser();
if (parser)
parser->appendOutputParser(new QtSupport::QtParser);
else
parser = new QtSupport::QtParser;
if (tc)
parser->appendOutputParser(tc->outputParser());
parser->setWorkingDirectory(workingDirectory);
setOutputParser(parser);
m_scriptTarget = (static_cast<Qt4Project *>(bc->target()->project())->rootQt4ProjectNode()->projectType() == ScriptTemplate);
return AbstractProcessStep::init();
}
示例5: init
bool MakeStep::init()
{
Qt4BuildConfiguration *bc = qt4BuildConfiguration();
Environment environment = bc->environment();
setEnvironment(environment);
QString workingDirectory;
if (bc->subNodeBuild())
workingDirectory = bc->subNodeBuild()->buildDir();
else
workingDirectory = bc->buildDirectory();
setWorkingDirectory(workingDirectory);
QString makeCmd = bc->makeCommand();
if (!m_makeCmd.isEmpty())
makeCmd = m_makeCmd;
if (!QFileInfo(makeCmd).isAbsolute()) {
// Try to detect command in environment
const QString tmp = environment.searchInPath(makeCmd);
if (tmp.isEmpty()) {
QTextCharFormat textCharFormat;
textCharFormat.setForeground(Qt::red);
emit addOutput(tr("Could not find make command: %1 in the build environment").arg(makeCmd), textCharFormat);
return false;
}
makeCmd = tmp;
}
setCommand(makeCmd);
// If we are cleaning, then make can fail with a error code, but that doesn't mean
// we should stop the clean queue
// That is mostly so that rebuild works on a already clean project
setIgnoreReturnValue(m_clean);
QStringList args = m_userArgs;
if (!m_clean) {
if (!bc->defaultMakeTarget().isEmpty())
args << bc->defaultMakeTarget();
}
// -w option enables "Enter"/"Leaving directory" messages, which we need for detecting the
// absolute file path
// FIXME doing this without the user having a way to override this is rather bad
// so we only do it for unix and if the user didn't override the make command
// but for now this is the least invasive change
ProjectExplorer::ToolChain *toolchain = bc->toolChain();
if (toolchain) {
if (toolchain->type() != ProjectExplorer::ToolChain::MSVC &&
toolchain->type() != ProjectExplorer::ToolChain::WINCE) {
if (m_makeCmd.isEmpty())
args << "-w";
}
}
setEnabled(true);
setArguments(args);
setOutputParser(new ProjectExplorer::GnuMakeParser(workingDirectory));
if (toolchain)
appendOutputParser(toolchain->outputParser());
return AbstractProcessStep::init();
}