Library version information logging to aid debugging.

master
Andrew Copland 2017-12-22 14:54:20 +00:00
parent 154ad850d7
commit 7c175325bf
5 changed files with 53 additions and 4 deletions

View File

@ -84,6 +84,7 @@
#include "ui/Lua.h"
#include <algorithm>
#include <sstream>
#include "versioningInfo.h"
#ifdef PROFILE_LUA_TIME
#include <time.h>
@ -468,9 +469,8 @@ void Pi::Init(const std::map<std::string,std::string> &options, bool no_gui)
if (SDL_Init(sdlInitFlags) < 0) {
Error("SDL initialization failed: %s\n", SDL_GetError());
}
SDL_version ver;
SDL_GetVersion(&ver);
Output("SDL Version %d.%d.%d\n", ver.major, ver.minor, ver.patch);
OutputVersioningInfo();
Graphics::RendererGL2::RegisterRenderer();
Graphics::RendererOGL::RegisterRenderer();

31
src/versioningInfo.cpp Normal file
View File

@ -0,0 +1,31 @@
// Copyright © 2008-2017 Pioneer Developers. See AUTHORS.txt for details
// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
#include "versioningInfo.h"
#include "libs.h"
#include "utils.h"
// open asset importer
#include <assimp/version.h>
// freetype
#include "ft2build.h"
#include FT_FREETYPE_H
#ifdef ENABLE_SERVER_AGENT
#include <curl/curlver.h>
#endif
void OutputVersioningInfo()
{
SDL_version ver;
SDL_GetVersion(&ver);
Output("\n--------------------\n");
Output("SDL Version %d.%d.%d\n", ver.major, ver.minor, ver.patch);
Output("SDL_image ver: %d.%d.%d\n", SDL_IMAGE_MAJOR_VERSION, SDL_IMAGE_MINOR_VERSION, SDL_IMAGE_PATCHLEVEL);
Output("Assimp ver: %u.%u.%u\n", aiGetVersionMajor(), aiGetVersionMinor(), aiGetVersionRevision());
Output("FreeType ver: %d.%d.%d\n", FREETYPE_MAJOR, FREETYPE_MINOR, FREETYPE_PATCH);
#ifdef ENABLE_SERVER_AGENT
Output("LibCurl ver: %s", LIBCURL_VERSION);
#endif
Output("\n--------------------\n");
}

10
src/versioningInfo.h Normal file
View File

@ -0,0 +1,10 @@
// Copyright © 2008-2017 Pioneer Developers. See AUTHORS.txt for details
// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
#ifndef _VERSIONINGINFO_H
#define _VERSIONINGINFO_H
// Output version info for libraries used by the game to aid debugging
void OutputVersioningInfo();
#endif /* _VERSIONINGINFO_H */

View File

@ -522,6 +522,7 @@
<ClCompile Include="..\..\src\Tombstone.cpp" />
<ClCompile Include="..\..\src\UIView.cpp" />
<ClCompile Include="..\..\src\utils.cpp" />
<ClCompile Include="..\..\src\versioningInfo.cpp" />
<ClCompile Include="..\..\src\View.cpp" />
<ClCompile Include="..\..\src\win32\FileSystemWin32.cpp" />
<ClCompile Include="..\..\src\win32\OSWin32.cpp" />
@ -677,6 +678,7 @@
<ClInclude Include="..\..\src\utils.h" />
<ClInclude Include="..\..\src\vector2.h" />
<ClInclude Include="..\..\src\vector3.h" />
<ClInclude Include="..\..\src\versioningInfo.h" />
<ClInclude Include="..\..\src\VideoLink.h" />
<ClInclude Include="..\..\src\View.h" />
<ClInclude Include="..\..\src\win32\TextUtils.h" />

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="src">
@ -465,6 +465,9 @@
<ClCompile Include="..\..\contrib\imgui\examples\sdl_opengl2_example\imgui_impl_sdl.cpp">
<Filter>src\imgui</Filter>
</ClCompile>
<ClCompile Include="..\..\src\versioningInfo.cpp">
<Filter>src</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\Aabb.h">
@ -932,6 +935,9 @@
<ClInclude Include="..\..\contrib\imgui\examples\sdl_opengl2_example\imgui_impl_sdl.h">
<Filter>src\imgui</Filter>
</ClInclude>
<ClInclude Include="..\..\src\versioningInfo.h">
<Filter>src</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\src\win32\pioneer.rc">