summaryrefslogtreecommitdiff
path: root/src/serialport/serialport-lib.pri
diff options
context:
space:
mode:
authorLaszlo Papp <lpapp@kde.org>2013-11-23 10:32:01 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-25 09:55:06 +0100
commitd97a152bf14cd7b58e576bd6b4a5f304527f940e (patch)
treedf8317cc7ad8230dd109ba3b0951bfa0361c2ef4 /src/serialport/serialport-lib.pri
parent1a6ec9148a782c06ee84961c16a57411dc8bcbee (diff)
downloadqtserialport-d97a152bf14cd7b58e576bd6b4a5f304527f940e.tar.gz
Try to load udev at runtime if we do not link against it
There was an explicit option previously added into 5.2.0 due to lack of time to implement this runtime resolution properly. The libudev load variable can now be eliminated which also simplifies the packaging. This change also takes care of avoiding the regression by not loading udev at runtime at all for Qt 4. That has always been the case, so there are no regressions there. A TODO comment has been left in the code though about it. The helper free functions cannot be static because they are declared as friend outside that source file. Ideally, we could have a better approach, but that would require more significant refactoring, and such a revamp has to become stable in the 'dev' branch before going into the 'stable' branch. Thereby, this is an acceptable compromise. It does not break binary compatibility either to remove or add friend declarations to a class. The change has been tested on Archlinux (x86_64) with Qt 4 and then 5 using the cenumerator example. The change has been tested both with udev and without that, i.e with sysfs on my Linux system. Change-Id: Ia7d7ecb336c1de1913e1dd60177ae7469e90c329 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'src/serialport/serialport-lib.pri')
-rw-r--r--src/serialport/serialport-lib.pri2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/serialport/serialport-lib.pri b/src/serialport/serialport-lib.pri
index 7ad55f8..4c7e732 100644
--- a/src/serialport/serialport-lib.pri
+++ b/src/serialport/serialport-lib.pri
@@ -1,6 +1,6 @@
INCLUDEPATH += $$PWD
-!contains(DEFINES, LOAD_LIBUDEV): unix {
+unix {
greaterThan(QT_MAJOR_VERSION, 4) {
contains(QT_CONFIG, libudev) {
DEFINES += LINK_LIBUDEV