本文整理汇总了C++中QmakeBuildConfiguration::buildType方法的典型用法代码示例。如果您正苦于以下问题:C++ QmakeBuildConfiguration::buildType方法的具体用法?C++ QmakeBuildConfiguration::buildType怎么用?C++ QmakeBuildConfiguration::buildType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QmakeBuildConfiguration
的用法示例。
在下文中一共展示了QmakeBuildConfiguration::buildType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: bundleDirectory
FileName IosRunConfiguration::bundleDirectory() const
{
FileName res;
Core::Id devType = DeviceTypeKitInformation::deviceTypeId(target()->kit());
bool isDevice = (devType == Constants::IOS_DEVICE_TYPE);
if (!isDevice && devType != Constants::IOS_SIMULATOR_TYPE) {
qCWarning(iosLog) << "unexpected device type in bundleDirForTarget: " << devType.toString();
return res;
}
QmakeBuildConfiguration *bc =
qobject_cast<QmakeBuildConfiguration *>(target()->activeBuildConfiguration());
if (bc) {
QmakeProject *pro = qobject_cast<QmakeProject *>(target()->project());
const QmakeProFileNode *node = 0;
if (pro)
node = pro->rootProjectNode();
if (node)
node = node->findProFileFor(profilePath());
if (node) {
TargetInformation ti = node->targetInformation();
if (ti.valid)
res = FileName::fromString(ti.buildDir);
}
if (res.isEmpty())
res = bc->buildDirectory();
switch (bc->buildType()) {
case BuildConfiguration::Debug :
case BuildConfiguration::Unknown :
if (isDevice)
res.appendPath(QLatin1String("Debug-iphoneos"));
else
res.appendPath(QLatin1String("Debug-iphonesimulator"));
break;
case BuildConfiguration::Profile :
case BuildConfiguration::Release :
if (isDevice)
res.appendPath(QLatin1String("Release-iphoneos"));
else
res.appendPath(QLatin1String("Release-iphonesimulator"));
break;
default:
qCWarning(iosLog) << "IosBuildStep had an unknown buildType "
<< target()->activeBuildConfiguration()->buildType();
}
}
res.appendPath(applicationName() + QLatin1String(".app"));
return res;
}
示例2: init
bool MakeStep::init(QList<const BuildStep *> &earlierSteps)
{
QmakeBuildConfiguration *bc = qmakeBuildConfiguration();
if (!bc)
bc = qobject_cast<QmakeBuildConfiguration *>(target()->activeBuildConfiguration());
if (!bc)
emit addTask(Task::buildConfigurationMissingTask());
ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit());
if (!tc)
emit addTask(Task::compilerMissingTask());
if (!bc || !tc) {
emitFaultyConfigurationMessage();
return false;
}
ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc->macroExpander());
QString workingDirectory;
if (bc->subNodeBuild())
workingDirectory = bc->subNodeBuild()->buildDir();
else
workingDirectory = bc->buildDirectory().toString();
pp->setWorkingDirectory(workingDirectory);
pp->setCommand(effectiveMakeCommand());
// 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;
QmakeProjectManager::QmakeProFileNode *subNode = bc->subNodeBuild();
if (subNode) {
QString makefile = subNode->makefile();
if (makefile.isEmpty())
makefile = QLatin1String("Makefile");
// Use Makefile.Debug and Makefile.Release
// for file builds, since the rules for that are
// only in those files.
if (subNode->isDebugAndRelease() && bc->fileNodeBuild()) {
if (bc->buildType() == QmakeBuildConfiguration::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 (bc->fileNodeBuild() && subNode) {
QString objectsDir = subNode->objectsDirectory();
if (objectsDir.isEmpty()) {
objectsDir = subNode->buildDir(bc);
if (subNode->isDebugAndRelease()) {
if (bc->buildType() == QmakeBuildConfiguration::Debug)
objectsDir += QLatin1String("/debug");
else
objectsDir += QLatin1String("/release");
}
}
QString relObjectsDir = QDir(pp->workingDirectory()).relativeFilePath(objectsDir);
if (relObjectsDir == QLatin1String("."))
relObjectsDir.clear();
if (!relObjectsDir.isEmpty())
relObjectsDir += QLatin1Char('/');
QString objectFile = relObjectsDir +
bc->fileNodeBuild()->filePath().toFileInfo().baseName() +
subNode->objectExtension();
Utils::QtcProcess::addArg(&args, objectFile);
}
Utils::Environment env = bc->environment();
Utils::Environment::setupEnglishOutput(&env);
// We also prepend "L" to the MAKEFLAGS, so that nmake / jom are less verbose
if (tc && makeCommand().isEmpty()) {
if (tc->targetAbi().os() == Abi::WindowsOS
&& tc->targetAbi().osFlavor() != Abi::WindowsMSysFlavor) {
const QString makeFlags = QLatin1String("MAKEFLAGS");
env.set(makeFlags, QLatin1Char('L') + env.value(makeFlags));
}
}
pp->setEnvironment(env);
pp->setArguments(args);
//.........这里部分代码省略.........