summaryrefslogtreecommitdiff
path: root/src/utils/dumplibs.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-01-19 17:23:04 +0300
committerAndrei Karas <akaras@inbox.ru>2017-01-19 17:23:04 +0300
commitf97cceeb5ea00862d967a829ab5d25466dbb18e8 (patch)
tree978faf093442dce95da5222d03ae258973531b50 /src/utils/dumplibs.cpp
parent623a64f2c96b71f8609eccb81cb04886ae390c7b (diff)
downloadplus-f97cceeb5ea00862d967a829ab5d25466dbb18e8.tar.gz
plus-f97cceeb5ea00862d967a829ab5d25466dbb18e8.tar.bz2
plus-f97cceeb5ea00862d967a829ab5d25466dbb18e8.tar.xz
plus-f97cceeb5ea00862d967a829ab5d25466dbb18e8.zip
Add all used SDL libs into dumping compiled and linked versions.
Diffstat (limited to 'src/utils/dumplibs.cpp')
-rw-r--r--src/utils/dumplibs.cpp38
1 files changed, 36 insertions, 2 deletions
diff --git a/src/utils/dumplibs.cpp b/src/utils/dumplibs.cpp
index 6a6e378ba..84e61b784 100644
--- a/src/utils/dumplibs.cpp
+++ b/src/utils/dumplibs.cpp
@@ -22,14 +22,48 @@
#include "logger.h"
+#include <SDL.h>
+#include <SDL_image.h>
+#include <SDL_net.h>
+#include <SDL_ttf.h>
#include <zlib.h>
#include "debug.h"
+#define dumpCompiledSdlVersion(text, prefix) \
+ logger->log(" " text ": %d.%d.%d", \
+ prefix##_MAJOR_VERSION, \
+ prefix##_MINOR_VERSION, \
+ prefix##_PATCHLEVEL)
+
+static void dumpLinkedSdlVersion(const char *const text,
+ const SDL_version *const version)
+{
+ if (version)
+ {
+ logger->log(" %s: %d.%d.%d",
+ text,
+ version->major,
+ version->minor,
+ version->patch);
+ }
+}
+
void dumpLibs()
{
- logger->log("Compiled with zLib: %s", ZLIB_VERSION);
+ logger->log("Compiled with:");
+ logger->log(" zLib: %s", ZLIB_VERSION);
+ dumpCompiledSdlVersion("SDL", SDL);
+ dumpCompiledSdlVersion("SDL_net", SDL_NET);
+ dumpCompiledSdlVersion("SDL_image", SDL_IMAGE);
+ dumpCompiledSdlVersion("SDL_ttf", SDL_TTF);
+
+ logger->log("Linked with:");
#if ZLIB_VERNUM >= 0x1020
- logger->log("Linked with zLib: %s", zlibVersion());
+ logger->log(" zLib: %s", zlibVersion());
#endif // ZLIB_VERNUM >= 0x1020
+ dumpLinkedSdlVersion("SDL", SDL_Linked_Version());
+ dumpLinkedSdlVersion("SDL_net", SDLNet_Linked_Version());
+ dumpLinkedSdlVersion("SDL_image", IMG_Linked_Version());
+ dumpLinkedSdlVersion("SDL_ttf", TTF_Linked_Version());
}