本文整理汇总了C++中ProbeABI::isCompatible方法的典型用法代码示例。如果您正苦于以下问题:C++ ProbeABI::isCompatible方法的具体用法?C++ ProbeABI::isCompatible怎么用?C++ ProbeABI::isCompatible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProbeABI
的用法示例。
在下文中一共展示了ProbeABI::isCompatible方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: findBestMatchingABI
ProbeABI findBestMatchingABI(const ProbeABI &targetABI, const QVector<ProbeABI> &availableABIs)
{
QVector<ProbeABI> compatABIs;
foreach (const ProbeABI &abi, availableABIs) {
if (targetABI.isCompatible(abi))
compatABIs.push_back(abi);
}
if (compatABIs.isEmpty())
return ProbeABI();
std::sort(compatABIs.begin(), compatABIs.end());
return compatABIs.last();
}
示例2: testProbeABICompat
void testProbeABICompat()
{
#ifndef Q_OS_WIN
const ProbeABI targetABI = ProbeABI::fromString(QStringLiteral("qt5_2-x86_64"));
const ProbeABI probeABI = ProbeABI::fromString(QStringLiteral("qt5_1-x86_64"));
#if defined(Q_OS_MAC)
const bool debugAbiMatters = true;
#else
const bool debugAbiMatters = false;
#endif
const bool compilerAbiMatters = false;
#else
const ProbeABI targetABI = ProbeABI::fromString(QStringLiteral("qt5_2-MSVC-140-x86_64"));
const ProbeABI probeABI = ProbeABI::fromString(QStringLiteral("qt5_1-MSVC-140-x86_64"));
const bool debugAbiMatters = true;
const bool compilerAbiMatters = true;
#endif
// full match, or same major version and older probe
QVERIFY(targetABI.isCompatible(targetABI));
QVERIFY(targetABI.isCompatible(probeABI));
// incompatible
// newer minor version probe
QVERIFY(!probeABI.isCompatible(targetABI));
// different major version
ProbeABI incompatABI(probeABI);
incompatABI.setQtVersion(4, 8);
QVERIFY(!targetABI.isCompatible(incompatABI));
QVERIFY(!incompatABI.isCompatible(targetABI));
// different architecture
incompatABI = targetABI;
incompatABI.setArchitecture(QStringLiteral("i686"));
QVERIFY(!targetABI.isCompatible(incompatABI));
// different debug/release mode
incompatABI = targetABI;
incompatABI.setIsDebug(true);
QCOMPARE(targetABI.isCompatible(incompatABI), !debugAbiMatters);
// different compiler
incompatABI = targetABI;
incompatABI.setCompiler(QStringLiteral("Clang"));
QCOMPARE(targetABI.isCompatible(incompatABI), !compilerAbiMatters);
}