From: Mikko Rasa Date: Fri, 19 Dec 2014 03:26:04 +0000 (+0200) Subject: Dirty hack to pull the image loaders in when linking statically X-Git-Url: http://git.tdb.fi/?p=libs%2Fgui.git;a=commitdiff_plain;h=917222bae696465f99024e0e15f73ba1058add44 Dirty hack to pull the image loaders in when linking statically I can't find any way to add metadata to the symbols to forcibly pull them in, so this will have to do. --- diff --git a/source/graphics/imageloader.cpp b/source/graphics/imageloader.cpp index 06b70d1..fbba25c 100644 --- a/source/graphics/imageloader.cpp +++ b/source/graphics/imageloader.cpp @@ -2,6 +2,18 @@ #include #include #include "imageloader.h" +#ifdef WITH_LIBPNG +#include "png/pngloader.h" +#endif +#ifdef WITH_LIBJPEG +#include "jpeg/jpegloader.h" +#endif +#ifdef WITH_DEVIL +#include "devil/devilloader.h" +#endif +#ifdef WITH_QUARTZ +#include "quartz/quartzloader.h" +#endif using namespace std; @@ -36,6 +48,19 @@ ImageLoader *ImageLoader::open_file(const string &fn) ImageLoader *ImageLoader::open_io(IO::Seekable &io) { +#ifdef WITH_LIBPNG + (void)RegisteredImageLoader::reg; +#endif +#ifdef WITH_LIBJPEG + (void)RegisteredImageLoader::reg; +#endif +#ifdef WITH_DEVIL + (void)RegisteredImageLoader::reg; +#endif +#ifdef WITH_QUARTZ + (void)RegisteredImageLoader::reg; +#endif + list &loaders = get_registered_loaders(); if(registered_loaders_changed) { diff --git a/source/graphics/imageloader.h b/source/graphics/imageloader.h index 85e6b52..031ecb4 100644 --- a/source/graphics/imageloader.h +++ b/source/graphics/imageloader.h @@ -58,6 +58,8 @@ public: template class RegisteredImageLoader: public ImageLoader { + friend class ImageLoader; + private: class Register: public RegisterBase {