From 917222bae696465f99024e0e15f73ba1058add44 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 19 Dec 2014 05:26:04 +0200 Subject: [PATCH] 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. --- source/graphics/imageloader.cpp | 25 +++++++++++++++++++++++++ source/graphics/imageloader.h | 2 ++ 2 files changed, 27 insertions(+) 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 { -- 2.45.2