From kde-buildsystem Sun Apr 27 23:33:59 2008 From: Modestas Vainius Date: Sun, 27 Apr 2008 23:33:59 +0000 To: kde-buildsystem Subject: Reducing excess linkage - cmake 2.6 IMPORTED targets and Message-Id: <200804280234.00146.modestas () vainius ! eu> X-MARC-Message: https://marc.info/?l=kde-buildsystem&m=120933928105592 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============1648555126==" --===============1648555126== Content-Type: multipart/signed; boundary="nextPart5706796.FQkeRucpYL"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart5706796.FQkeRucpYL Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello, It's a follow up for http://bugs.kde.org/show_bug.cgi?id=3D160976. Please r= ead=20 this bug report for the background on the issue. Short description of the=20 patches can be found in the bug report too. =46irst of all, the patch (97th) [1] should be compatible with cmake 2.4.x.= If=20 kdelibs is compiled with cmake 2.4.x, the "old way" of adding numerous (but= in=20 most cases excess which is the problem being fixed here) libraries in=20 target_LIB_DEPENDS to respective KDE4_*_LIBS is used. Then either cmake 2.4= =20 or 2.6 can be used to build other KDE modules and everything should build=20 fine without a single change. However, if cmake 2.6 is used to compile kdelibs, the new way of exporting= =20 dependences (IMPORTED targets) is used. However, in this case other KDE4=20 project cannot be built with cmake 2.4 against such kdelibs, cmake 2.6=20 becomes a minimum requirement. Well, resolution of the bug in question has been delayed by Alex, but, in m= y=20 opinion, it's a mistake. Impact of this change is likely to be very broad=20 because it might affect almost all KDE4 based software (official and 3rd=20 party) (a real impact depends on what LINK_INTERFACE_LIBRARIES will be set = to=20 for kdelibs core libs), so this transition cannot be completed in a day. Th= e=20 earlier you start doing the changes, the better. Advantages: 1) As Alex said previously, cmake 2.6 is not stable yet (but will be soon),= so=20 most of cmake 2.6 users are probably developers. Fortunately, developers ar= e=20 the target audience to fix TARGET_LINK_LIBRARIES() and add=20 LINK_INTERFACE_LIBRARIES for library targets (the latter is only needed if= =20 lib is heavily depended on by other targets) in their CMakeLists.txt's.=20 What's more and what's very important, the changes they make will be=20 backwards compatible with cmake 2.4. 2) Developers of kdelibs core libraries need to decide/discuss what libs to= =20 put in LINK_INTERFACE_LIBRARIES. Preliminary and probably a bit wrong stuff= =20 is in my 98 patch [2]. However, kdelibs (cmake 2.6+new way) builds with tha= t=20 patch. 3) Finally, if kdelibs is build with cmake 2.4, the user is not affected at= =20 all due to fallback to the previous way. Maybe you can even implement an=20 option to disable "the new way" on cmake 2.6, but I suggest "the new way" t= o=20 be enabled by default when kdelibs is compiled with cmake 2.6, otherwise ju= st=20 a few other developers will notice linkage problems. To sum up, cmake 2.4 users don't "lose" anything and this build system=20 migration is done incrementally as more and more devs start using cmake 2.6= =20 to build kdelibs and fix TARGET_LINK_LIBRARIES() themselves or more users=20 complain about linking failures. This transition should be started by completing point 2. P.S. My proposal does not completely solve excess linkage problem, however = it=20 improves situation significantly. To solve the issue completely, recursive= =20 linking should be "disabled" by setting LINK_INTERFACE_LIBRARIES to "" for= =20 almost all libs. Such change would break build of almost everything though)= =2E=20 See [3] and [4] for more information. 1.=20 http://svn.debian.org/wsvn/pkg-kde/branches/kde4/packages/kdelibs/debian/pa= tches/97_use_imported_targets_with_cmake26.diff?op=3Dfile&rev=3D0&sc=3D0=20 svn://svn.debian.org/svn/pkg-kde/branches/kde4/packages/kdelibs/debian/patc= hes/97_use_imported_targets_with_cmake26.diff 2.=20 http://svn.debian.org/wsvn/pkg-kde/branches/kde4/packages/kdelibs/debian/pa= tches/98_link_interface_libraries.diff?op=3Dfile&rev=3D0&sc=3D0=20 svn://svn.debian.org/svn/pkg-kde/branches/kde4/packages/kdelibs/debian/patc= hes/98_link_interface_libraries.diff 3. http://public.kitware.com/Bug/view.php?id=3D6846 4. http://www.vtk.org/Bug/view.php?id=3D3490 =2D-=20 Modestas Vainius --nextPart5706796.FQkeRucpYL Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBIFQ1oHO9JRnPq4hQRApVlAKCaf6VYl66Df3yRBF2YbMRvN+BfhQCfQ+kl M8Q9mdxlhoLqZcU6TTgUQls= =tUbp -----END PGP SIGNATURE----- --nextPart5706796.FQkeRucpYL-- --===============1648555126== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kde-buildsystem mailing list Kde-buildsystem@kde.org https://mail.kde.org/mailman/listinfo/kde-buildsystem --===============1648555126==--