本文整理汇总了C++中projectexplorer::ToolChain类的典型用法代码示例。如果您正苦于以下问题:C++ ToolChain类的具体用法?C++ ToolChain怎么用?C++ ToolChain使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ToolChain类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
bool AndroidPackageInstallationStep::init()
{
ProjectExplorer::BuildConfiguration *bc = buildConfiguration();
QString dirPath = bc->buildDirectory().appendPath(QLatin1String(Constants::ANDROID_BUILDDIRECTORY)).toString();
if (Utils::HostOsInfo::isWindowsHost())
if (bc->environment().searchInPath(QLatin1String("sh.exe")).isEmpty())
dirPath = QDir::toNativeSeparators(dirPath);
ProjectExplorer::ToolChain *tc
= ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
ProjectExplorer::ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc->macroExpander());
pp->setWorkingDirectory(bc->buildDirectory().toString());
pp->setCommand(tc->makeCommand(bc->environment()));
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"));
pp->setEnvironment(env);
pp->setArguments(QString::fromLatin1("INSTALL_ROOT=\"%1\" install").arg(dirPath));
pp->resolveAll();
setOutputParser(new ProjectExplorer::GnuMakeParser());
ProjectExplorer::IOutputParser *parser = target()->kit()->createOutputParser();
if (parser)
appendOutputParser(parser);
outputParser()->setWorkingDirectory(pp->effectiveWorkingDirectory());
m_androidDirToClean = dirPath;
return AbstractProcessStep::init();
}
示例2: foreach
QList<ProjectExplorer::Task> BaseQtVersion::validateKit(const ProjectExplorer::Kit *k)
{
QList<ProjectExplorer::Task> result;
BaseQtVersion *version = QtKitInformation::qtVersion(k);
Q_ASSERT(version == this);
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
const QList<ProjectExplorer::Abi> qtAbis = version->qtAbis();
if (tc && !qtAbis.contains(tc->targetAbi())) {
QString qtAbiString;
foreach (const ProjectExplorer::Abi &qtAbi, qtAbis) {
if (!qtAbiString.isEmpty())
qtAbiString.append(QLatin1Char(' '));
qtAbiString.append(qtAbi.toString());
}
const QString message = QCoreApplication::translate("BaseQtVersion",
"The compiler '%1' (%2) cannot produce code for the Qt version '%3' (%4).").
arg(tc->displayName(),
tc->targetAbi().toString(),
version->displayName(),
qtAbiString);
result << ProjectExplorer::Task(ProjectExplorer::Task::Error,
message, FileName(), -1,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
} // Abi mismatch
示例3: genericTarget
ProjectExplorer::IOutputParser *GenericBuildConfiguration::createOutputParser() const
{
ProjectExplorer::ToolChain *tc = genericTarget()->genericProject()->toolChain();
if (tc)
return tc->outputParser();
return 0;
}
示例4: deducedArguments
QMakeStepConfig QMakeStep::deducedArguments() const
{
ProjectExplorer::Kit *kit = target()->kit();
QMakeStepConfig config;
ProjectExplorer::ToolChain *tc
= ProjectExplorer::ToolChainKitInformation::toolChain(kit);
ProjectExplorer::Abi targetAbi;
if (tc)
targetAbi = tc->targetAbi();
BaseQtVersion *version = QtKitInformation::qtVersion(target()->kit());
config.archConfig = QMakeStepConfig::targetArchFor(targetAbi, version);
config.osType = QMakeStepConfig::osTypeFor(targetAbi, version);
if (linkQmlDebuggingLibrary() && version && version->qtVersion().majorVersion >= 5)
config.linkQmlDebuggingQQ2 = true;
if (useQtQuickCompiler() && version)
config.useQtQuickCompiler = true;
if (separateDebugInfo())
config.separateDebugInfo = true;
return config;
}
示例5: createBuildInfo
BuildInfo CMakeBuildConfigurationFactory::createBuildInfo(const Kit *k,
const QString &sourceDir,
BuildType buildType) const
{
BuildInfo info(this);
info.kitId = k->id();
CMakeExtraBuildInfo extra;
extra.sourceDirectory = sourceDir;
CMakeConfigItem buildTypeItem;
switch (buildType) {
case BuildTypeNone:
info.typeName = tr("Build");
break;
case BuildTypeDebug:
buildTypeItem = {CMakeConfigItem("CMAKE_BUILD_TYPE", "Debug")};
info.typeName = tr("Debug");
info.buildType = BuildConfiguration::Debug;
break;
case BuildTypeRelease:
buildTypeItem = {CMakeConfigItem("CMAKE_BUILD_TYPE", "Release")};
info.typeName = tr("Release");
info.buildType = BuildConfiguration::Release;
break;
case BuildTypeMinSizeRel:
buildTypeItem = {CMakeConfigItem("CMAKE_BUILD_TYPE", "MinSizeRel")};
info.typeName = tr("Minimum Size Release");
info.buildType = BuildConfiguration::Release;
break;
case BuildTypeRelWithDebInfo:
buildTypeItem = {CMakeConfigItem("CMAKE_BUILD_TYPE", "RelWithDebInfo")};
info.typeName = tr("Release with Debug Information");
info.buildType = BuildConfiguration::Profile;
break;
default:
QTC_CHECK(false);
break;
}
if (!buildTypeItem.isNull())
extra.configuration.append(buildTypeItem);
const QString sysRoot = SysRootKitInformation::sysRoot(k).toString();
if (!sysRoot.isEmpty()) {
extra.configuration.append(CMakeConfigItem("CMAKE_SYSROOT", sysRoot.toUtf8()));
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(
k, ProjectExplorer::Constants::CXX_LANGUAGE_ID);
if (tc) {
const QByteArray targetTriple = tc->originalTargetTriple().toUtf8();
extra.configuration.append(CMakeConfigItem("CMAKE_C_COMPILER_TARGET", targetTriple));
extra.configuration.append(CMakeConfigItem("CMAKE_CXX_COMPILER_TARGET ", targetTriple));
}
}
info.extraInfo = QVariant::fromValue(extra);
return info;
}
示例6: deducedArguments
///
/// moreArguments,
/// -unix for Maemo
/// QMAKE_VAR_QMLJSDEBUGGER_PATH
QStringList QMakeStep::deducedArguments()
{
QStringList arguments;
ProjectExplorer::ToolChain *tc
= ProjectExplorer::ToolChainProfileInformation::toolChain(target()->profile());
ProjectExplorer::Abi targetAbi;
if (tc)
targetAbi = tc->targetAbi();
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
if ((targetAbi.osFlavor() == ProjectExplorer::Abi::HarmattanLinuxFlavor
|| targetAbi.osFlavor() == ProjectExplorer::Abi::MaemoLinuxFlavor))
arguments << QLatin1String("-unix");
#endif
// explicitly add architecture to CONFIG
if ((targetAbi.os() == ProjectExplorer::Abi::MacOS)
&& (targetAbi.binaryFormat() == ProjectExplorer::Abi::MachOFormat)) {
if (targetAbi.architecture() == ProjectExplorer::Abi::X86Architecture) {
if (targetAbi.wordWidth() == 32)
arguments << QLatin1String("CONFIG+=x86");
else if (targetAbi.wordWidth() == 64)
arguments << QLatin1String("CONFIG+=x86_64");
} else if (targetAbi.architecture() == ProjectExplorer::Abi::PowerPCArchitecture) {
if (targetAbi.wordWidth() == 32)
arguments << QLatin1String("CONFIG+=ppc");
else if (targetAbi.wordWidth() == 64)
arguments << QLatin1String("CONFIG+=ppc64");
}
}
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target()->profile());
if (linkQmlDebuggingLibrary() && version) {
if (!version->needsQmlDebuggingLibrary()) {
// This Qt version has the QML debugging services built in, however
// they still need to be enabled at compile time
arguments << (version->qtVersion().majorVersion >= 5 ?
QLatin1String(Constants::QMAKEVAR_DECLARATIVE_DEBUG5) :
QLatin1String(Constants::QMAKEVAR_DECLARATIVE_DEBUG4));
} else {
const QString qmlDebuggingHelperLibrary = version->qmlDebuggingHelperLibrary(true);
if (!qmlDebuggingHelperLibrary.isEmpty()) {
// Do not turn debugger path into native path separators: Qmake does not like that!
const QString debuggingHelperPath
= QFileInfo(qmlDebuggingHelperLibrary).dir().path();
arguments << QLatin1String(Constants::QMAKEVAR_QMLJSDEBUGGER_PATH)
+ QLatin1Char('=') + debuggingHelperPath;
}
}
}
return arguments;
}
示例7: buildCommand
QString PuppetCreator::buildCommand() const
{
Utils::Environment environment = Utils::Environment::systemEnvironment();
m_kit->addToEnvironment(environment);
ProjectExplorer::ToolChain *toolChain = ProjectExplorer::ToolChainKitInformation::toolChain(m_kit);
if (toolChain)
return toolChain->makeCommand(environment);
return QString();
}
示例8:
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;
}
示例9: genericDeployConfigurationId
QList<Core::Id> RemoteLinuxDeployConfigurationFactory::availableCreationIds(Target *parent) const
{
QList<Core::Id> ids;
if (!parent->project()->supportsKit(parent->kit()))
return ids;
ProjectExplorer::ToolChain *tc
= ProjectExplorer::ToolChainKitInformation::toolChain(parent->kit());
if (!tc || tc->targetAbi().os() != ProjectExplorer::Abi::LinuxOS)
return ids;
const Core::Id devType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(parent->kit());
if (devType == Constants::GenericLinuxOsType)
ids << genericDeployConfigurationId();
return ids;
}
示例10: moreArguments
///
/// moreArguments,
/// -unix for Maemo
/// -after OBJECTS_DIR, MOC_DIR, UI_DIR, RCC_DIR
/// QMAKE_VAR_QMLJSDEBUGGER_PATH
QStringList QMakeStep::moreArguments()
{
Qt4BuildConfiguration *bc = qt4BuildConfiguration();
QStringList arguments;
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
ProjectExplorer::ToolChain *tc = bc->toolChain();
if (tc && (tc->targetAbi().osFlavor() == ProjectExplorer::Abi::HarmattanLinuxFlavor
|| tc->targetAbi().osFlavor() == ProjectExplorer::Abi::MaemoLinuxFlavor))
arguments << QLatin1String("-unix");
#endif
if (linkQmlDebuggingLibrary() && bc->qtVersion()) {
if (!bc->qtVersion()->needsQmlDebuggingLibrary()) {
// This Qt version has the QML debugging services built in, however
// they still need to be enabled at compile time
arguments << QLatin1String("CONFIG+=declarative_debug");
} else {
QString qmlDebuggingHelperLibrary = bc->qtVersion()->qmlDebuggingHelperLibrary(true);
if (!qmlDebuggingHelperLibrary.isEmpty()) {
// Do not turn debugger path into native path separators: Qmake does not like that!
const QString debuggingHelperPath
= QFileInfo(qmlDebuggingHelperLibrary).dir().path();
arguments << QLatin1String(Constants::QMAKEVAR_QMLJSDEBUGGER_PATH)
+ QLatin1Char('=') + debuggingHelperPath;
}
}
}
if (bc->qtVersion() && !bc->qtVersion()->supportsShadowBuilds()) {
// We have a target which does not allow shadow building.
// But we really don't want to have the build artefacts in the source dir
// so we try to hack around it, to make the common cases work.
// This is a HACK, remove once the symbian make generator supports
// shadow building
arguments << QLatin1String("-after")
<< QLatin1String("OBJECTS_DIR=obj")
<< QLatin1String("MOC_DIR=moc")
<< QLatin1String("UI_DIR=ui")
<< QLatin1String("RCC_DIR=rcc");
}
return arguments;
}
示例11: deducedArguments
///
/// moreArguments,
/// iphoneos/iphonesimulator for ios
/// QMAKE_VAR_QMLJSDEBUGGER_PATH
QStringList QMakeStep::deducedArguments()
{
QStringList arguments;
ProjectExplorer::ToolChain *tc
= ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
ProjectExplorer::Abi targetAbi;
if (tc)
targetAbi = tc->targetAbi();
// explicitly add architecture to CONFIG
if ((targetAbi.os() == ProjectExplorer::Abi::MacOS)
&& (targetAbi.binaryFormat() == ProjectExplorer::Abi::MachOFormat)) {
if (targetAbi.architecture() == ProjectExplorer::Abi::X86Architecture) {
if (targetAbi.wordWidth() == 32)
arguments << QLatin1String("CONFIG+=x86");
else if (targetAbi.wordWidth() == 64)
arguments << QLatin1String("CONFIG+=x86_64");
const char IOSQT[] = "Qt4ProjectManager.QtVersion.Ios"; // from Ios::Constants (include header?)
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
if (version && version->type() == QLatin1String(IOSQT))
arguments << QLatin1String("CONFIG+=iphonesimulator");
} else if (targetAbi.architecture() == ProjectExplorer::Abi::PowerPCArchitecture) {
if (targetAbi.wordWidth() == 32)
arguments << QLatin1String("CONFIG+=ppc");
else if (targetAbi.wordWidth() == 64)
arguments << QLatin1String("CONFIG+=ppc64");
} else if (targetAbi.architecture() == ProjectExplorer::Abi::ArmArchitecture) {
arguments << QLatin1String("CONFIG+=iphoneos");
}
}
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
if (linkQmlDebuggingLibrary() && version) {
arguments << QLatin1String(Constants::QMAKEVAR_QUICK1_DEBUG);
if (version->qtVersion().majorVersion >= 5)
arguments << QLatin1String(Constants::QMAKEVAR_QUICK2_DEBUG);
}
return arguments;
}
示例12: updateDetails
void MakeStepConfigWidget::updateDetails()
{
CMakeBuildConfiguration *bc = m_makeStep->cmakeBuildConfiguration();
ProjectExplorer::ToolChain *tc = bc->toolChain();
if (tc) {
QString arguments = Utils::QtcProcess::joinArgs(m_makeStep->m_buildTargets);
Utils::QtcProcess::addArgs(&arguments, m_makeStep->additionalArguments());
ProcessParameters param;
param.setMacroExpander(bc->macroExpander());
param.setEnvironment(bc->environment());
param.setWorkingDirectory(bc->buildDirectory());
param.setCommand(tc->makeCommand());
param.setArguments(arguments);
m_summaryText = param.summary(displayName());
} else {
m_summaryText = tr("<b>Unknown tool chain</b>");
}
emit updateSummary();
}
示例13: updateDetails
void MakeStepConfigWidget::updateDetails()
{
Qt4Project *pro = static_cast<Qt4Project *>(m_makeStep->project());
ProjectExplorer::BuildConfiguration *bc = pro->buildConfiguration(m_buildConfiguration);
QString workingDirectory = pro->buildDirectory(bc);
QString makeCmd = pro->makeCommand(bc);
if (!m_makeStep->value(m_buildConfiguration, "makeCmd").toString().isEmpty())
makeCmd = m_makeStep->value(m_buildConfiguration, "makeCmd").toString();
if (!QFileInfo(makeCmd).isAbsolute()) {
Environment environment = pro->environment(bc);
// Try to detect command in environment
QString tmp = environment.searchInPath(makeCmd);
if (tmp == QString::null) {
m_summaryText = tr("<b>Make Step:</b> %1 not found in the environment.").arg(makeCmd);
emit updateSummary();
return;
}
makeCmd = tmp;
}
// -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
QStringList args = m_makeStep->value(m_buildConfiguration, "makeargs").toStringList();
ProjectExplorer::ToolChain::ToolChainType t = ProjectExplorer::ToolChain::UNKNOWN;
ProjectExplorer::ToolChain *toolChain = pro->toolChain(bc);
if (toolChain)
t = toolChain->type();
if (t != ProjectExplorer::ToolChain::MSVC && t != ProjectExplorer::ToolChain::WINCE) {
if (m_makeStep->value(m_buildConfiguration, "makeCmd").toString().isEmpty())
args << "-w";
}
m_summaryText = tr("<b>Make:</b> %1 %2 in %3").arg(QFileInfo(makeCmd).fileName(), args.join(" "),
QDir::toNativeSeparators(workingDirectory));
emit updateSummary();
}
示例14: deducedArguments
///
/// moreArguments,
/// iphoneos/iphonesimulator for ios
/// QMAKE_VAR_QMLJSDEBUGGER_PATH
QStringList QMakeStep::deducedArguments()
{
QStringList arguments;
ProjectExplorer::ToolChain *tc
= ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
ProjectExplorer::Abi targetAbi;
if (tc)
targetAbi = tc->targetAbi();
// explicitly add architecture to CONFIG
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
arguments << QmakeBuildConfiguration::deduceArgumnetsForTargetAbi(targetAbi, version);
if (linkQmlDebuggingLibrary() && version && !useQtQuickCompiler()) {
arguments << QLatin1String(Constants::QMAKEVAR_QUICK1_DEBUG);
if (version->qtVersion().majorVersion >= 5)
arguments << QLatin1String(Constants::QMAKEVAR_QUICK2_DEBUG);
}
if (useQtQuickCompiler() && version)
arguments << QLatin1String("CONFIG+=qtquickcompiler");
return arguments;
}
示例15: addProfileFromKit
void QbsManager::addProfileFromKit(const ProjectExplorer::Kit *k)
{
QStringList usedProfileNames = profileNames();
const QString name = ProjectExplorer::Project::makeUnique(
QString::fromLatin1("qtc_") + k->fileSystemFriendlyName(), usedProfileNames);
setProfileForKit(name, k);
QVariantMap data;
QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(k);
if (qt) {
data.insert(QLatin1String(QTCORE_BINPATH), qt->binPath().toUserOutput());
QStringList builds;
if (qt->hasDebugBuild())
builds << QLatin1String("debug");
if (qt->hasReleaseBuild())
builds << QLatin1String("release");
data.insert(QLatin1String(QTCORE_BUILDVARIANT), builds);
data.insert(QLatin1String(QTCORE_DOCPATH), qt->docsPath().toUserOutput());
data.insert(QLatin1String(QTCORE_INCPATH), qt->headerPath().toUserOutput());
data.insert(QLatin1String(QTCORE_LIBPATH), qt->libraryPath().toUserOutput());
Utils::FileName mkspecPath = qt->mkspecsPath();
mkspecPath.appendPath(qt->mkspec().toString());
data.insert(QLatin1String(QTCORE_MKSPEC), mkspecPath.toUserOutput());
data.insert(QLatin1String(QTCORE_NAMESPACE), qt->qtNamespace());
data.insert(QLatin1String(QTCORE_LIBINFIX), qt->qtLibInfix());
data.insert(QLatin1String(QTCORE_VERSION), qt->qtVersionString());
if (qt->isFrameworkBuild())
data.insert(QLatin1String(QTCORE_FRAMEWORKBUILD), true);
}
if (ProjectExplorer::SysRootKitInformation::hasSysRoot(k))
data.insert(QLatin1String(QBS_SYSROOT), ProjectExplorer::SysRootKitInformation::sysRoot(k).toUserOutput());
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
if (tc) {
// FIXME/CLARIFY: How to pass the sysroot?
ProjectExplorer::Abi targetAbi = tc->targetAbi();
QString architecture = ProjectExplorer::Abi::toString(targetAbi.architecture());
if (targetAbi.wordWidth() == 64)
architecture.append(QLatin1String("_64"));
data.insert(QLatin1String(QBS_ARCHITECTURE), architecture);
if (targetAbi.endianness() == ProjectExplorer::Abi::BigEndian)
data.insert(QLatin1String(QBS_ENDIANNESS), QLatin1String("big"));
else
data.insert(QLatin1String(QBS_ENDIANNESS), QLatin1String("little"));
if (targetAbi.os() == ProjectExplorer::Abi::WindowsOS) {
data.insert(QLatin1String(QBS_TARGETOS), QLatin1String("windows"));
data.insert(QLatin1String(QBS_TOOLCHAIN),
targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMSysFlavor
? QStringList() << QLatin1String("mingw") << QLatin1String("gcc")
: QStringList() << QLatin1String("msvc"));
} else if (targetAbi.os() == ProjectExplorer::Abi::MacOS) {
data.insert(QLatin1String(QBS_TARGETOS), QStringList() << QLatin1String("osx")
<< QLatin1String("darwin") << QLatin1String("unix"));
if (tc->type() != QLatin1String("clang")) {
data.insert(QLatin1String(QBS_TOOLCHAIN), QLatin1String("gcc"));
} else {
data.insert(QLatin1String(QBS_TOOLCHAIN),
QStringList() << QLatin1String("clang")
<< QLatin1String("llvm")
<< QLatin1String("gcc"));
}
} else if (targetAbi.os() == ProjectExplorer::Abi::LinuxOS) {
data.insert(QLatin1String(QBS_TARGETOS), QStringList() << QLatin1String("linux")
<< QLatin1String("unix"));
if (tc->type() != QLatin1String("clang")) {
data.insert(QLatin1String(QBS_TOOLCHAIN), QLatin1String("gcc"));
} else {
data.insert(QLatin1String(QBS_TOOLCHAIN),
QStringList() << QLatin1String("clang")
<< QLatin1String("llvm")
<< QLatin1String("gcc"));
}
}
Utils::FileName cxx = tc->compilerCommand();
data.insert(QLatin1String(CPP_TOOLCHAINPATH), cxx.toFileInfo().absolutePath());
data.insert(QLatin1String(CPP_COMPILERNAME), cxx.toFileInfo().fileName());
}
addProfile(name, data);
}