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)
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
#include <AL/alc.h>
#endif
-#include <ogg/ogg.h>
#include <vorbis/vorbisfile.h>
#ifdef _WIN32
#include <jpeglib.h>
#include <png.h>
#include <stdio.h>
-#include <zlib.h>
+
+#ifndef WIN32
+#include <unistd.h>
+#endif
/* These two are needed for screenshot */
extern int kContextWidth;
#include <set>
#include <stdio.h>
#include <string.h>
-#include <zlib.h>
using namespace Game;
#ifdef WIN32
#include <shellapi.h>
#include <windows.h>
+#else
+#include <unistd.h>
#endif
extern float multiplier;