Add support for loading udev at run-time
authorLaszlo Papp <lpapp@kde.org>
Thu, 24 Oct 2013 23:22:16 +0000 (00:22 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 28 Oct 2013 14:36:30 +0000 (15:36 +0100)
commitd4c0885256f3005a8758153c1b82d467ee87478d
treedb5a0db2ecfcaf77e60497bf4f136ec05c01cc2a
parent609b5c9fa7ba47157e1e1831270e2a2bd926b460
Add support for loading udev at run-time

QtSerialPort is linked against udev by default if the development files can be
detected on the system. The reason for this is that, it is more common to link
against udev than loading it at run-time. People will usually use distribution
packages where there cannot be inconsistency between different versions, and
hence ABI breaks, etc.

The relevant LINK_LIBUDEV variable will be set. This can be overridden by
defining LOAD_LIBUDEV for qmake:

    qmake "DEFINES += LOAD_LIBUDEV" -r

It is also worth noting that the common code is separated into a private header,
and it can be included for either type of libudev usage. There is no need
for its user to handle the compile-time linking or run-time loading separately
on top of that.

Task-number: QTBUG-34329
Change-Id: I45ffaaede2a74498587a6452fbe3fec7eaf83483
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
src/serialport/qserialportinfo_unix.cpp
src/serialport/qtudev_p.h [new file with mode: 0644]
src/serialport/serialport-lib.pri