From 6f9609cebe4bcb87a7722b628b02a1975c56148c Mon Sep 17 00:00:00 2001 From: Martin Erik Werner Date: Sat, 20 May 2017 21:27:59 +0200 Subject: [PATCH] Remove some unneeded libs & headers Based on some hints by the automatic dependency checking in Debian packaging[0], it appears that, at least on Debian GNU/Linux, quite a few of the libs that lugaru links against are not needed. Remove linking to those libs, and use of related unneeded headers. * For ogg/vorbis, it seems like libogg is not needed unless handling container metadata? * For opengl, there seems to be only a subset of the libs that are required. Notably the glext.h header seems to only be needed on windows for GL_GENERATE_MIPMAP, but not otherwise. * For zlib it seems to be unused, but removing zlib.h exposed a dependency on unistd.h which is now included directly on non-windows. [0] dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/lugaru/usr/games/lugaru was not linked against libz.so.1 (it uses none of the library's symbols) dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/lugaru/usr/games/lugaru was not linked against libSM.so.6 (it uses none of the library's symbols) dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/lugaru/usr/games/lugaru was not linked against libX11.so.6 (it uses none of the library's symbols) dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/lugaru/usr/games/lugaru was not linked against libogg.so.0 (it uses none of the library's symbols) dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/lugaru/usr/games/lugaru was not linked against libXext.so.6 (it uses none of the library's symbols) dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/lugaru/usr/games/lugaru was not linked against libICE.so.6 (it uses none of the library's symbols) --- CMakeLists.txt | 5 +---- Source/Audio/openal_wrapper.hpp | 1 - Source/Utils/ImageIO.cpp | 5 ++++- Source/main.cpp | 3 ++- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ae389fe..30616f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -219,22 +219,19 @@ endif(APPLE) find_package(PNG REQUIRED) find_package(JPEG REQUIRED) -find_package(ZLIB REQUIRED) find_package(OggVorbis REQUIRED) include_directories( ${OPENAL_INCLUDE_DIR} ${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} - ${ZLIB_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} ${SDL2_INCLUDE_DIRS} ${VORBISFILE_INCLUDE_DIR} - ${OGG_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/Source ) -set(LUGARU_LIBS ${OPENAL_LIBRARY} ${PNG_LIBRARY} ${JPEG_LIBRARY} ${ZLIB_LIBRARIES} ${SDL2_LIBRARIES} ${OPENGL_LIBRARIES} ${VORBISFILE_LIBRARY} ${OGG_LIBRARY} ${PLATFORM_LIBS}) +set(LUGARU_LIBS ${OPENAL_LIBRARY} ${PNG_LIBRARY} ${JPEG_LIBRARY} ${SDL2_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${VORBISFILE_LIBRARY} ${PLATFORM_LIBS}) ### Definitions diff --git a/Source/Audio/openal_wrapper.hpp b/Source/Audio/openal_wrapper.hpp index 379949f..99c4c2f 100644 --- a/Source/Audio/openal_wrapper.hpp +++ b/Source/Audio/openal_wrapper.hpp @@ -32,7 +32,6 @@ along with Lugaru. If not, see . #include #endif -#include #include #ifdef _WIN32 diff --git a/Source/Utils/ImageIO.cpp b/Source/Utils/ImageIO.cpp index c19a63e..689224e 100644 --- a/Source/Utils/ImageIO.cpp +++ b/Source/Utils/ImageIO.cpp @@ -26,7 +26,10 @@ along with Lugaru. If not, see . #include #include #include -#include + +#ifndef WIN32 +#include +#endif /* These two are needed for screenshot */ extern int kContextWidth; diff --git a/Source/main.cpp b/Source/main.cpp index 3593c69..e0270b6 100644 --- a/Source/main.cpp +++ b/Source/main.cpp @@ -32,13 +32,14 @@ along with Lugaru. If not, see . #include #include #include -#include using namespace Game; #ifdef WIN32 #include #include +#else +#include #endif extern float multiplier; -- 2.39.2