diff options
author | Laszlo Papp <lpapp@kde.org> | 2013-11-23 10:32:01 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-25 09:55:06 +0100 |
commit | d97a152bf14cd7b58e576bd6b4a5f304527f940e (patch) | |
tree | df8317cc7ad8230dd109ba3b0951bfa0361c2ef4 /src/serialport/serialport-lib.pri | |
parent | 1a6ec9148a782c06ee84961c16a57411dc8bcbee (diff) | |
download | qtserialport-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.pri | 2 |
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 |