From f91c14bb752bd03ae0674b7138165c3cb6c0c626 Mon Sep 17 00:00:00 2001 From: Lukas Pfeifhofer Date: Mon, 7 Feb 2022 10:51:34 +0100 Subject: [PATCH] Make qca optional, only required for TI backend. --- libnymea-zigbee/backends/ti/zigbeenetworkti.cpp | 4 +++- libnymea-zigbee/libnymea-zigbee.pro | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/libnymea-zigbee/backends/ti/zigbeenetworkti.cpp b/libnymea-zigbee/backends/ti/zigbeenetworkti.cpp index 0d5be41..b95ab36 100644 --- a/libnymea-zigbee/backends/ti/zigbeenetworkti.cpp +++ b/libnymea-zigbee/backends/ti/zigbeenetworkti.cpp @@ -32,7 +32,9 @@ #include "zigbeenetworkdatabase.h" #include +#ifndef DISABLE_QCA #include +#endif ZigbeeNetworkTi::ZigbeeNetworkTi(const QUuid &networkUuid, QObject *parent) : ZigbeeNetwork(networkUuid, parent) @@ -291,7 +293,7 @@ void ZigbeeNetworkTi::processGreenPowerFrame(const Zigbee::ApsdeDataIndication & QByteArray ZigbeeNetworkTi::encryptSecurityKey(quint32 sourceId, const QByteArray &securityKey) { -#if (QCA_VERSION >= QCA_VERSION_CHECK(2, 2, 0)) +#ifndef DISABLE_QCA QByteArray sourceIdArray; sourceIdArray.append(static_cast(sourceId & 0x000000ff)); sourceIdArray.append(static_cast((sourceId & 0x0000ff00) >> 8)); diff --git a/libnymea-zigbee/libnymea-zigbee.pro b/libnymea-zigbee/libnymea-zigbee.pro index 7f701c4..d3fd6f4 100644 --- a/libnymea-zigbee/libnymea-zigbee.pro +++ b/libnymea-zigbee/libnymea-zigbee.pro @@ -12,7 +12,13 @@ packagesExist(libudev) { DEFINES += DISABLE_UDEV } -PKGCONFIG += qca2-qt5 +packagesExist(qca2-qt5) { + message(Build with libqca2 support) + PKGCONFIG += qca2-qt5 +} else { + message(Build without libqca2 support) + DEFINES += DISABLE_QCA +} SOURCES += \ backends/deconz/interface/zigbeeinterfacedeconz.cpp \