Skip to content

Commit 35eadde

Browse files
committed
Plugins::FreeRDP: add to check QSerialPort
1 parent 212a065 commit 35eadde

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

‎Plugins/FreeRDP/Client/BackendFreeRDP.cpp‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@
3434
#include <QMutexLocker>
3535
#include <QPainter>
3636
#include <QPrinterInfo>
37-
#include <QSerialPort>
38-
#include <QSerialPortInfo>
37+
#ifdef HAVE_SerialPort
38+
#include <QSerialPort>
39+
#include <QSerialPortInfo>
40+
#endif
3941
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
4042
#include <QSoundEffect>
4143
#else
@@ -2498,6 +2500,7 @@ int CBackendFreeRDP::RedirectionPrinter()
24982500

24992501
int CBackendFreeRDP::RedirectionSerial()
25002502
{
2503+
#if HAVE_SerialPort
25012504
//TODO: FreeRDP don't support
25022505
return 0;
25032506
rdpContext* pRdpContext = (rdpContext*)m_pContext;
@@ -2532,6 +2535,7 @@ int CBackendFreeRDP::RedirectionSerial()
25322535
return -1;
25332536
}
25342537
}
2538+
#endif
25352539

25362540
return 0;
25372541
}

‎Plugins/FreeRDP/Client/CMakeLists.txt‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,18 @@ if(MINGW)
5959
set(FreeRDP_OPTIONS -fpermissive)
6060
endif()
6161

62-
set(FreeRDP_QT_COMPONENTS Widgets Multimedia PrintSupport SerialPort)
62+
set(FreeRDP_QT_COMPONENTS Widgets Multimedia PrintSupport)
6363
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS ${FreeRDP_QT_COMPONENTS})
6464
if(Qt${QT_VERSION_MAJOR}_FOUND)
6565
FOREACH(_COMPONENT ${FreeRDP_QT_COMPONENTS})
6666
list(APPEND FreeRDP_LIBS Qt${QT_VERSION_MAJOR}::${_COMPONENT})
6767
ENDFOREACH()
6868
endif()
69+
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS SerialPort)
70+
if(Qt${QT_VERSION_MAJOR}_FOUND)
71+
list(APPEND FreeRDP_DEFINITIONS HAVE_SerialPort)
72+
endif()
73+
6974
ADD_PLUGIN_TARGET(NAME PluginClient${PROJECT_NAME}
7075
ISPLUGIN
7176
SOURCE_FILES ${FreeRDP_SOURCE_FILES} ${FreeRDP_HEADER_FILES} ${FreeRDP_UI_FILES}

0 commit comments

Comments
 (0)