本文整理汇总了C++中projectexplorer::ToolChain类的典型用法代码示例。如果您正苦于以下问题:C++ ToolChain类的具体用法?C++ ToolChain怎么用?C++ ToolChain使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ToolChain类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
开发者ID:beyondyuanshu,项目名称:qt-creator,代码行数:32,代码来源:androidpackageinstallationstep.cpp
示例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
开发者ID:CNOT,项目名称:julia-studio,代码行数:27,代码来源:baseqtversion.cpp
示例3: genericTarget
ProjectExplorer::IOutputParser *GenericBuildConfiguration::createOutputParser() const
{
ProjectExplorer::ToolChain *tc = genericTarget()->genericProject()->toolChain();
if (tc)
return tc->outputParser();
return 0;
}
开发者ID:,项目名称:,代码行数:7,代码来源:
示例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;
}
开发者ID:lostcodder,项目名称:qt-creator,代码行数:25,代码来源:qmakestep.cpp
示例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;
}
开发者ID:sailfish-sdk,项目名称:sailfish-qtcreator,代码行数:58,代码来源:cmakebuildconfiguration.cpp
示例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;
}
开发者ID:KDE,项目名称:android-qt-creator,代码行数:58,代码来源:qmakestep.cpp
示例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();
}
开发者ID:colede,项目名称:qtcreator,代码行数:12,代码来源:puppetcreator.cpp
示例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;
}
开发者ID:jereupchurch,项目名称:cmakeprojectmanager,代码行数:13,代码来源:cmakebuildconfiguration.cpp
示例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;
}
开发者ID:FlavioFalcao,项目名称:qt-creator,代码行数:14,代码来源:remotelinuxdeployconfigurationfactory.cpp
示例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;
}
开发者ID:,项目名称:,代码行数:48,代码来源:
示例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;
}
开发者ID:edwardZhang,项目名称:qt-creator,代码行数:46,代码来源:qmakestep.cpp
示例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();
}
开发者ID:pcacjr,项目名称:qt-creator,代码行数:20,代码来源:makestep.cpp
示例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();
}
开发者ID:asokolov,项目名称:ananas-creator,代码行数:38,代码来源:makestep.cpp
示例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;
}
开发者ID:AltarBeastiful,项目名称:qt-creator,代码行数:28,代码来源:qmakestep.cpp
示例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);
}
开发者ID:aizaimenghuangu,项目名称:QtTestor,代码行数:82,代码来源:qbsprojectmanager.cpp
示例16: init
bool AndroidDeployQtStep::init(QList<const BuildStep *> &earlierSteps)
{
Q_UNUSED(earlierSteps);
m_androiddeployqtArgs.clear();
if (AndroidManager::checkForQt51Files(project()->projectDirectory()))
emit addOutput(tr("Found old folder \"android\" in source directory. Qt 5.2 does not use that folder by default."), ErrorOutput);
m_targetArch = AndroidManager::targetArch(target());
if (m_targetArch.isEmpty()) {
emit addOutput(tr("No Android arch set by the .pro file."), ErrorOutput);
return false;
}
AndroidBuildApkStep *androidBuildApkStep
= AndroidGlobal::buildStep<AndroidBuildApkStep>(target()->activeBuildConfiguration());
if (!androidBuildApkStep) {
emit addOutput(tr("Cannot find the android build step."), ErrorOutput);
return false;
}
int deviceAPILevel = AndroidManager::minimumSDK(target());
AndroidConfigurations::Options options = AndroidConfigurations::None;
if (androidBuildApkStep->deployAction() == AndroidBuildApkStep::DebugDeployment)
options = AndroidConfigurations::FilterAndroid5;
AndroidDeviceInfo info = earlierDeviceInfo(earlierSteps, Id);
if (!info.isValid()) {
info = AndroidConfigurations::showDeviceDialog(project(), deviceAPILevel, m_targetArch, options);
m_deviceInfo = info; // Keep around for later steps
}
if (!info.isValid()) // aborted
return false;
m_avdName = info.avdname;
m_serialNumber = info.serialNumber;
m_appProcessBinaries.clear();
m_libdir = QLatin1String("lib");
if (info.cpuAbi.contains(QLatin1String("arm64-v8a")) ||
info.cpuAbi.contains(QLatin1String("x86_64"))) {
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit(), ToolChain::Language::Cxx);
if (tc && tc->targetAbi().wordWidth() == 64) {
m_appProcessBinaries << QLatin1String("/system/bin/app_process64");
m_libdir += QLatin1String("64");
} else {
m_appProcessBinaries << QLatin1String("/system/bin/app_process32");
}
} else {
m_appProcessBinaries << QLatin1String("/system/bin/app_process32")
<< QLatin1String("/system/bin/app_process");
}
AndroidManager::setDeviceSerialNumber(target(), m_serialNumber);
ProjectExplorer::BuildConfiguration *bc = target()->activeBuildConfiguration();
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
if (!version)
return false;
m_uninstallPreviousPackageRun = m_uninstallPreviousPackage;
if (m_uninstallPreviousPackageRun)
m_manifestName = AndroidManager::manifestPath(target());
m_useAndroiddeployqt = version->qtVersion() >= QtSupport::QtVersionNumber(5, 4, 0);
if (m_useAndroiddeployqt) {
Utils::FileName tmp = AndroidManager::androidQtSupport(target())->androiddeployqtPath(target());
if (tmp.isEmpty()) {
emit addOutput(tr("Cannot find the androiddeployqt tool."), ErrorOutput);
return false;
}
m_command = tmp.toString();
m_workingDirectory = bc->buildDirectory().appendPath(QLatin1String(Constants::ANDROID_BUILDDIRECTORY)).toString();
Utils::QtcProcess::addArg(&m_androiddeployqtArgs, QLatin1String("--verbose"));
Utils::QtcProcess::addArg(&m_androiddeployqtArgs, QLatin1String("--output"));
Utils::QtcProcess::addArg(&m_androiddeployqtArgs, m_workingDirectory);
Utils::QtcProcess::addArg(&m_androiddeployqtArgs, QLatin1String("--no-build"));
Utils::QtcProcess::addArg(&m_androiddeployqtArgs, QLatin1String("--input"));
tmp = AndroidManager::androidQtSupport(target())->androiddeployJsonPath(target());
if (tmp.isEmpty()) {
emit addOutput(tr("Cannot find the androiddeploy Json file."), ErrorOutput);
return false;
}
Utils::QtcProcess::addArg(&m_androiddeployqtArgs, tmp.toString());
Utils::QtcProcess::addArg(&m_androiddeployqtArgs, QLatin1String("--deployment"));
switch (androidBuildApkStep->deployAction()) {
case AndroidBuildApkStep::MinistroDeployment:
Utils::QtcProcess::addArg(&m_androiddeployqtArgs, QLatin1String("ministro"));
break;
case AndroidBuildApkStep::DebugDeployment:
Utils::QtcProcess::addArg(&m_androiddeployqtArgs, QLatin1String("debug"));
break;
case AndroidBuildApkStep::BundleLibrariesDeployment:
Utils::QtcProcess::addArg(&m_androiddeployqtArgs, QLatin1String("bundled"));
break;
}
//.........这里部分代码省略.........
开发者ID:littlejohn19,项目名称:qt-creator,代码行数:101,代码来源:androiddeployqtstep.cpp
示例17: QObject
LibraryDetailsController::LibraryDetailsController(
Ui::LibraryDetailsWidget *libraryDetails,
const QString &proFile, QObject *parent) :
QObject(parent),
m_platforms(AddLibraryWizard::LinuxPlatform
| AddLibraryWizard::MacPlatform
| AddLibraryWizard::WindowsMinGWPlatform
| AddLibraryWizard::WindowsMSVCPlatform),
m_linkageType(AddLibraryWizard::NoLinkage),
m_macLibraryType(AddLibraryWizard::NoLibraryType),
m_proFile(proFile),
m_ignoreGuiSignals(false),
m_includePathChanged(false),
m_linkageRadiosVisible(true),
m_macLibraryRadiosVisible(true),
m_includePathVisible(true),
m_windowsGroupVisible(true),
m_libraryDetailsWidget(libraryDetails)
{
switch (Utils::HostOsInfo::hostOs()) {
case Utils::OsTypeMac:
m_creatorPlatform = CreatorMac;
break;
case Utils::OsTypeLinux:
m_creatorPlatform = CreatorLinux;
break;
case Utils::OsTypeWindows:
m_creatorPlatform = CreatorWindows;
break;
default:
break;
}
if (!Utils::HostOsInfo::isLinuxHost()) {
// project for which we are going to insert the snippet
const Project *project = SessionManager::projectForFile(proFile);
if (project && project->activeTarget()) {
// if its tool chain is maemo behave the same as we would be on linux
ProjectExplorer::ToolChain *tc = ToolChainKitInformation::toolChain(project->activeTarget()->kit());
if (tc) {
switch (tc->targetAbi().os()) {
case Abi::WindowsOS:
m_creatorPlatform = CreatorWindows;
break;
case Abi::MacOS:
m_creatorPlatform = CreatorMac;
break;
default:
m_creatorPlatform = CreatorLinux;
break;
}
}
}
}
setPlatformsVisible(true);
setLinkageGroupVisible(true);
setMacLibraryGroupVisible(true);
setPackageLineEditVisible(false);
if (creatorPlatform() == CreatorMac)
setMacLibraryRadiosVisible(false);
if (creatorPlatform() != CreatorWindows)
setLinkageRadiosVisible(false);
connect(m_libraryDetailsWidget->includePathChooser, SIGNAL(changed(QString)),
this, SLOT(slotIncludePathChanged()));
connect(m_libraryDetailsWidget->frameworkRadio, SIGNAL(clicked(bool)),
this, SLOT(slotMacLibraryTypeChanged()));
connect(m_libraryDetailsWidget->libraryRadio, SIGNAL(clicked(bool)),
this, SLOT(slotMacLibraryTypeChanged()));
connect(m_libraryDetailsWidget->useSubfoldersCheckBox, SIGNAL(toggled(bool)),
this, SLOT(slotUseSubfoldersChanged(bool)));
connect(m_libraryDetailsWidget->addSuffixCheckBox, SIGNAL(toggled(bool)),
this, SLOT(slotAddSuffixChanged(bool)));
connect(m_libraryDetailsWidget->linCheckBox, SIGNAL(clicked(bool)),
this, SLOT(slotPlatformChanged()));
connect(m_libraryDetailsWidget->macCheckBox, SIGNAL(clicked(bool)),
this, SLOT(slotPlatformChanged()));
connect(m_libraryDetailsWidget->winCheckBox, SIGNAL(clicked(bool)),
this, SLOT(slotPlatformChanged()));
}
开发者ID:FlavioFalcao,项目名称:qt-creator,代码行数:82,代码来源:librarydetailscontroller.cpp
示例18: 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();
}
开发者ID:,项目名称:,代码行数:93,代码来源:
示例19: init
bool MakeStep::init(const QString &name)
{
m_buildConfiguration = name;
ProjectExplorer::BuildConfiguration *bc = project()->buildConfiguration(name);
Environment environment = project()->environment(bc);
setEnvironment(name, environment);
Qt4Project *qt4project = qobject_cast<Qt4Project *>(project());
QString workingDirectory = qt4project->buildDirectory(bc);
setWorkingDirectory(name, workingDirectory);
QString makeCmd = qt4project->makeCommand(bc);
if (!value(name, "makeCmd").toString().isEmpty())
makeCmd = value(name, "makeCmd").toString();
if (!QFileInfo(makeCmd).isAbsolute()) {
// Try to detect command in environment
QString tmp = environment.searchInPath(makeCmd);
if (tmp == QString::null) {
emit addToOutputWindow(tr("<font color=\"#ff0000\">Could not find make command: %1 "\
"in the build environment</font>").arg(makeCmd));
return false;
}
makeCmd = tmp;
}
setCommand(name, makeCmd);
if (!value(name, "cleanConfig").isValid() && value("clean").isValid() && value("clean").toBool()) {
// Import old settings
setValue(name, "cleanConfig", true);
setValue(name, "makeargs", QStringList() << "clean");
}
|
请发表评论