Review Request 113670: Only link to Qt5::X11Extras and ${X11_LIBRARIES} if X11 was found

Martin Gräßlin mgraesslin at kde.org
Sat Nov 9 09:31:28 UTC 2013



> On Nov. 8, 2013, 5:25 p.m., Andrius da Costa Ribas wrote:
> > Please use X11 stuff conditionally (Q_WS_X11).
> 
> Alex Merry wrote:
>     There's no need to put conditionals in the file (since the whole thing is conditionally compiled), but the linking should be done conditionally.
>     
>     Specifically, you should take Qt5::X11Extras out of the target_link_libraries, and put it in its own call wrapped in X11_FOUND, like
>     if (X11_FOUND)
>        target_link_libraries(KDE4Support PRIVATE Qt5::X11Extras)
>     endif ()
>     
>     Or, even better, find the conditional where kxerrorhandler is added to libkde4support_SRCS, and add Qt5::X11Extras to libkd4support_OPTIONAL_LIBS in that same conditional.

> Please use X11 stuff conditionally (Q_WS_X11)
Just for your information: the macro Q_WS_X11 does not exist anymore. X11 specific code needs to check for X11 and/or XCB found (better XCB found). In addition it also needs a runtime check. We can no longer assume that if it's compiled for X11 it will run on X11.


- Martin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/113670/#review43271
-----------------------------------------------------------


On Nov. 8, 2013, 10:04 p.m., Alexander Richardson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/113670/
> -----------------------------------------------------------
> 
> (Updated Nov. 8, 2013, 10:04 p.m.)
> 
> 
> Review request for KDE Frameworks.
> 
> 
> Repository: kdelibs
> 
> 
> Description
> -------
> 
> Link kde4support privately to QtX11Extras, QtSvg and QtTest
> 
> Otherwise every user of the target KF5::KDE4Support will also have
> Qt5::X11Extras Qt5::Svg Qt5::Test linked.
> 
> This can cause linker errors like "ld: cannot find -lQt5::Test"
> 
> REVIEW: 113670
> 
> 
> Diffs
> -----
> 
>   tier4/kde4support/src/CMakeLists.txt cbfac3e 
>   tier4/kde4support/src/kdeui/kxerrorhandler.h babf931 
>   tier4/kde4support/src/kdeui/kxerrorhandler.cpp 3f4765d 
> 
> Diff: http://git.reviewboard.kde.org/r/113670/diff/
> 
> 
> Testing
> -------
> 
> I previously got the following error compiling okteta, now it works:
> /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: cannot find -lQt5::X11Extras
> /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: cannot find -lQt5::Svg
> 
> QtX11Info and QtSvg are not used in any installed headers, so IMO this should be fine
> qtest_kde.h does actually include QtTest headers, but only uses these types inside macros. And I guess any user of that header already also links to QtTest
> 
> 
> Thanks,
> 
> Alexander Richardson
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20131109/35190339/attachment.html>


More information about the Kde-frameworks-devel mailing list