本文整理汇总了C++中Abi::osFlavor方法的典型用法代码示例。如果您正苦于以下问题:C++ Abi::osFlavor方法的具体用法?C++ Abi::osFlavor怎么用?C++ Abi::osFlavor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Abi
的用法示例。
在下文中一共展示了Abi::osFlavor方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: targetAbi
QList<Utils::FileName> GccToolChain::suggestedMkspecList() const
{
Abi abi = targetAbi();
Abi host = Abi::hostAbi();
// Cross compile: Leave the mkspec alone!
if (abi.architecture() != host.architecture()
|| abi.os() != host.os()
|| abi.osFlavor() != host.osFlavor()) // Note: This can fail:-(
return QList<Utils::FileName>();
if (abi.os() == Abi::MacOS) {
QString v = version();
// prefer versioned g++ on mac. This is required to enable building for older Mac OS versions
if (v.startsWith(QLatin1String("4.0")) && m_compilerCommand.endsWith(QLatin1String("-4.0")))
return QList<Utils::FileName>() << Utils::FileName::fromString(QLatin1String("macx-g++40"));
if (v.startsWith(QLatin1String("4.2")) && m_compilerCommand.endsWith(QLatin1String("-4.2")))
return QList<Utils::FileName>() << Utils::FileName::fromString(QLatin1String("macx-g++42"));
return QList<Utils::FileName>() << Utils::FileName::fromString(QLatin1String("macx-g++"));
}
if (abi.os() == Abi::LinuxOS) {
if (abi.osFlavor() != Abi::GenericLinuxFlavor)
return QList<Utils::FileName>(); // most likely not a desktop, so leave the mkspec alone.
if (abi.wordWidth() == host.wordWidth())
return QList<Utils::FileName>() << Utils::FileName::fromString(QLatin1String("linux-g++")); // no need to explicitly set the word width
return QList<Utils::FileName>() << Utils::FileName::fromString(QLatin1String("linux-g++-") + QString::number(m_targetAbi.wordWidth()));
}
if (abi.os() == Abi::BsdOS && abi.osFlavor() == Abi::FreeBsdFlavor)
return QList<Utils::FileName>() << Utils::FileName::fromString(QLatin1String("freebsd-g++"));
return QList<Utils::FileName>();
}
示例2: setCustomAbi
void AbiWidget::setCustomAbi(const Abi ¤t)
{
bool blocked = blockSignals(true);
d->m_architectureComboBox->setCurrentIndex(static_cast<int>(current.architecture()));
d->m_osComboBox->setCurrentIndex(static_cast<int>(current.os()));
osChanged();
for (int i = 0; i < d->m_osFlavorComboBox->count(); ++i) {
if (d->m_osFlavorComboBox->itemData(i).toInt() == current.osFlavor()) {
d->m_osFlavorComboBox->setCurrentIndex(i);
break;
}
}
d->m_binaryFormatComboBox->setCurrentIndex(static_cast<int>(current.binaryFormat()));
for (int i = 0; i < d->m_wordWidthComboBox->count(); ++i) {
if (d->m_wordWidthComboBox->itemData(i).toInt() == current.wordWidth()) {
d->m_wordWidthComboBox->setCurrentIndex(i);
break;
}
}
if (d->isCustom())
d->m_abi->setItemData(0, current.toString());
blockSignals(blocked);
emit abiChanged();
}
示例3: detectClangClToolChain
// Detect Clang-cl on top of MSVC2015 or MSVC2013.
static void detectClangClToolChain(QList<ToolChain *> *list)
{
#ifdef Q_OS_WIN64
const char registryNode[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\LLVM\\LLVM";
#else
const char registryNode[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\LLVM\\LLVM";
#endif
const QSettings registry(QLatin1String(registryNode), QSettings::NativeFormat);
if (registry.status() != QSettings::NoError)
return;
const QString path = QDir::cleanPath(registry.value(QStringLiteral(".")).toString());
if (path.isEmpty())
return;
const unsigned char wordWidth = Utils::is64BitWindowsBinary(path + QStringLiteral("/bin/") + QLatin1String(clangClBinary))
? 64 : 32;
const ToolChain *toolChain = findMsvcToolChain(*list, wordWidth, Abi::WindowsMsvc2015Flavor);
if (!toolChain)
toolChain = findMsvcToolChain(*list, wordWidth, Abi::WindowsMsvc2013Flavor);
if (!toolChain) {
qWarning("Unable to find a suitable MSVC version for \"%s\".", qPrintable(QDir::toNativeSeparators(path)));
return;
}
const MsvcToolChain *msvcToolChain = static_cast<const MsvcToolChain *>(toolChain);
const Abi targetAbi = msvcToolChain->targetAbi();
const QString name = QStringLiteral("LLVM ") + QString::number(wordWidth)
+ QStringLiteral("bit based on ")
+ Abi::toString(targetAbi.osFlavor()).toUpper();
list->append(new ClangClToolChain(name, path, targetAbi,
msvcToolChain->varsBat(), msvcToolChain->varsBatArg(),
ToolChain::AutoDetection));
}
示例4: findOrDefault
static ToolChain *findMsvcToolChain(const QList<ToolChain *> &list,
unsigned char wordWidth, Abi::OSFlavor flavor)
{
return Utils::findOrDefault(list, [wordWidth, flavor] (const ToolChain *tc)
{ const Abi abi = tc->targetAbi();
return abi.osFlavor() == flavor
&& wordWidth == abi.wordWidth();} );
}
示例5: setCustomAbi
void AbiWidget::setCustomAbi(const Abi ¤t)
{
d->m_architectureComboBox->setCurrentIndex(static_cast<int>(current.architecture()));
d->m_osComboBox->setCurrentIndex(static_cast<int>(current.os()));
osChanged();
for (int i = 0; i < d->m_osFlavorComboBox->count(); ++i) {
if (d->m_osFlavorComboBox->itemData(i).toInt() == current.osFlavor()) {
d->m_osFlavorComboBox->setCurrentIndex(i);
break;
}
}
d->m_binaryFormatComboBox->setCurrentIndex(static_cast<int>(current.binaryFormat()));
for (int i = 0; i < d->m_wordWidthComboBox->count(); ++i) {
if (d->m_wordWidthComboBox->itemData(i).toInt() == current.wordWidth()) {
d->m_wordWidthComboBox->setCurrentIndex(i);
break;
}
}
}
示例6: ToolChain
MsvcToolChain::MsvcToolChain(const QString &name, const Abi &abi,
const QString &varsBat, const QString &varsBatArg, bool autodetect) :
ToolChain(QLatin1String(Constants::MSVC_TOOLCHAIN_ID), autodetect),
m_varsBat(varsBat),
m_varsBatArg(varsBatArg),
m_lastEnvironment(Utils::Environment::systemEnvironment()),
m_abi(abi)
{
Q_ASSERT(!name.isEmpty());
Q_ASSERT(!m_varsBat.isEmpty());
Q_ASSERT(QFileInfo(m_varsBat).exists());
Q_ASSERT(abi.os() == Abi::WindowsOS);
Q_ASSERT(abi.binaryFormat() == Abi::PEFormat);
Q_ASSERT(abi.osFlavor() != Abi::WindowsMSysFlavor);
setId(QString::fromLatin1("%1:%2.%3.%4").arg(Constants::MSVC_TOOLCHAIN_ID).arg(m_varsBat)
.arg(m_varsBatArg).arg(m_debuggerCommand));
setDisplayName(name);
}
示例7: abi
Abi QmlProjectRunConfiguration::abi() const
{
Abi hostAbi = Abi::hostAbi();
return Abi(hostAbi.architecture(), hostAbi.os(), hostAbi.osFlavor(),
Abi::RuntimeQmlFormat, hostAbi.wordWidth());
}