openmw binaries link to unnecessary libraries
as seen: https://forum.openmw.org/viewtopic.php?f=20&t=1882&start=60#p20966
openmw binaries link against unnecessary libraries. This causes extra dependencies to be pulled in by Debian and also uses extra resources. The libraries are: dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/openmw/usr/games/openmw was not linked against libdl.so.2 (it uses none of the library's symbols) dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/openmw/usr/games/openmw was not linked against libBulletSoftBody.so.2.81 (it uses none of the library's symbols) dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/openmw/usr/games/openmw was not linked against libXt.so.6 (it uses none of the library's symbols) dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/openmw/usr/games/openmw was not linked against libboost_date_time.so.1.54.0 (it uses none of the library's symbols) dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/openmw-cs/usr/games/opencs was not linked against libboost_date_time.so.1.54.0 (it uses none of the library's symbols) dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/openmw-cs/usr/games/opencs was not linked against libQtXmlPatterns.so.4 (it uses none of the library's symbols) dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/openmw-cs/usr/games/opencs was not linked against libQtXml.so.4 (it uses none of the library's symbols) dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/openmw-cs/usr/games/opencs was not linked against libboost_wave.so.1.54.0 (it uses none of the library's symbols) dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/openmw-cs/usr/games/opencs was not linked against libboost_thread.so.1.54.0 (it uses none of the library's symbols) dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/openmw-launcher/usr/games/omwlauncher was not linked against libXt.so.6 (it uses none of the library's symbols) dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/openmw-launcher/usr/games/omwlauncher debian/openmw-launcher/usr/games/mwiniimport were not linked against libboost_date_time.so.1.54.0 (they use none of the library's symbols) dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/openmw-launcher/usr/games/omwlauncher was not linked against libdl.so.2 (it uses none of the library's symbols) dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/openmw-launcher/usr/games/omwlauncher debian/openmw-launcher/usr/games/mwiniimport were not linked against libboost_thread.so.1.54.0 (they use none of the library's symbols) dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/openmw-launcher/usr/games/omwlauncher debian/openmw-launcher/usr/games/mwiniimport were not linked against libboost_wave.so.1.54.0 (they use none of the library's symbols)
Below is a patch which fixes all of them: Index: openmw/apps/launcher/CMakeLists.txt
--- openmw.orig/apps/launcher/CMakeLists.txt 2013-12-28 15:01:28.101035887 -0500 +++ openmw/apps/launcher/CMakeLists.txt 2013-12-28 15:01:28.037035886 -0500 @@ -137,8 +137,3 @@ target_link_libraries(omwlauncher gcov) endif()
-# Workaround for binutil => 2.23 problem when linking, should be fixed eventually upstream -if (UNIX AND NOT APPLE) -target_link_libraries(omwlauncher dl Xt) -endif()
Index: openmw/apps/openmw/CMakeLists.txt
--- openmw.orig/apps/openmw/CMakeLists.txt 2013-12-28 15:01:28.101035887 -0500 +++ openmw/apps/openmw/CMakeLists.txt 2013-12-28 15:04:37.945040399 -0500 @@ -78,6 +78,8 @@ )
Main executable
+set(BOOST_COMPONENTS system filesystem program_options thread wave) +find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
IF(OGRE_STATIC) ADD_DEFINITIONS(-DENABLE_PLUGIN_OctreeSceneManager -DENABLE_PLUGIN_ParticleFX -DENABLE_PLUGIN_GL) @@ -133,12 +135,6 @@ target_link_libraries(openmw ${CMAKE_THREAD_LIBS_INIT}) endif()
-# Workaround for binutil => 2.23 problem when linking, should be fixed eventually upstream -if (UNIX AND NOT APPLE) -target_link_libraries(openmw dl Xt) -endif()
if(APPLE) find_library(COCOA_FRAMEWORK Cocoa) find_library(IOKIT_FRAMEWORK IOKit) Index: openmw/apps/opencs/CMakeLists.txt
--- openmw.orig/apps/opencs/CMakeLists.txt 2013-12-28 15:01:28.101035887 -0500 +++ openmw/apps/opencs/CMakeLists.txt 2013-12-28 15:01:28.053035886 -0500 @@ -139,7 +139,7 @@ set(QT_USE_QTMAIN TRUE) endif(WIN32)
-find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork QtXml QtXmlPatterns REQUIRED) +find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork REQUIRED) include(${QT_USE_FILE})
qt4_wrap_ui(OPENCS_UI_HDR ${OPENCS_UI}) Index: openmw/CMakeLists.txt
--- openmw.orig/CMakeLists.txt 2013-12-28 15:01:28.101035887 -0500 +++ openmw/CMakeLists.txt 2013-12-28 15:04:33.769040300 -0500 @@ -208,7 +208,7 @@ endif ()
-set(BOOST_COMPONENTS system filesystem program_options thread date_time wave) +set(BOOST_COMPONENTS system filesystem program_options)
IF(BOOST_STATIC) set(Boost_USE_STATIC_LIBS ON) Index: openmw/cmake/FindBullet.cmake
--- openmw.orig/cmake/FindBullet.cmake 2013-12-28 15:01:28.101035887 -0500 +++ openmw/cmake/FindBullet.cmake 2013-12-28 15:01:28.097035887 -0500 @@ -60,8 +60,6 @@ _FIND_BULLET_LIBRARY(BULLET_COLLISION_LIBRARY_DEBUG BulletCollision_Debug BulletCollision_d) _FIND_BULLET_LIBRARY(BULLET_MATH_LIBRARY BulletMath LinearMath) _FIND_BULLET_LIBRARY(BULLET_MATH_LIBRARY_DEBUG BulletMath_Debug BulletMath_d LinearMath_debug LinearMath_d) -_FIND_BULLET_LIBRARY(BULLET_SOFTBODY_LIBRARY BulletSoftBody) -_FIND_BULLET_LIBRARY(BULLET_SOFTBODY_LIBRARY_DEBUG BulletSoftBody_Debug BulletSoftBody_d)
handle the QUIETLY and REQUIRED arguments and set BULLET_FOUND to TRUE if
@@ -69,12 +67,11 @@ include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Bullet DEFAULT_MSG BULLET_DYNAMICS_LIBRARY BULLET_COLLISION_LIBRARY BULLET_MATH_LIBRARY
- BULLET_SOFTBODY_LIBRARY BULLET_INCLUDE_DIR)
- BULLET_INCLUDE_DIR)
set(BULLET_INCLUDE_DIRS ${BULLET_INCLUDE_DIR}) if(BULLET_FOUND) _BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_DYNAMICS_LIBRARY) _BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_COLLISION_LIBRARY) _BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_MATH_LIBRARY)
- _BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_SOFTBODY_LIBRARY) endif()
I can do a pull request on github if prefered.
(RM-1064 from redmine: created on 2013-12-28 by Scott Howard, , closed on 2013-12-30 by Scott Howard)
Attachments: linking.patch