This repository has been archived on 2025-12-24. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
yachat/qcm/qca.qcm
2025-12-25 01:38:25 +05:00

53 lines
1.2 KiB
Text

/*
-----BEGIN QCMOD-----
name: external QCA 2.0
-----END QCMOD-----
*/
//----------------------------------------------------------------------------
// qc_qca
//----------------------------------------------------------------------------
class qc_qca : public ConfObj
{
public:
qc_qca(Conf *c) : ConfObj(c) {}
QString name() const { return "QCA 2.0"; }
QString shortname() const { return "qca"; }
QString checkString() const {
if (QFile::exists("third-party/qca/qca") && conf->getenv("QC_DISABLE_bundled_qca").isEmpty())
return "";
else
return ConfObj::checkString();
}
bool exec()
{
// Check if we have a bundnled version
if (QFile::exists("third-party/qca/qca") && conf->getenv("QC_DISABLE_bundled_qca").isEmpty())
return true;
// test for "crypto" feature and check qca version number
QString proextra =
"CONFIG += qt crypto\n"
"QT -= gui\n";
QString str =
"#include <QtCrypto>\n"
"\n"
"int main()\n"
"{\n"
" unsigned long x = QCA_VERSION;\n"
" if(x >= 0x016363) return 0; else return 1;\n"
"}\n";
int ret;
if(!conf->doCompileAndLink(str, QStringList(), QString(), proextra, &ret))
return false;
if(ret != 0)
return false;
return true;
}
};