Add SDL2 to main CMakeLists.txt.

Also expose SDL_LINK_DIR. This is required because the main target
inherits some of SDL2 extra dependcies (DirectX) for some reason.
This commit is contained in:
rude
2013-09-25 20:26:58 +02:00
parent c9f4f8a409
commit 4c59d385ef
3 changed files with 31 additions and 2 deletions
+16 -1
View File
@@ -14,6 +14,7 @@
#include "mpg123.h"
#include <freetype/config/ftconfig.h>
#include <freetype/freetype.h>
#include <SDL.h>
extern "C" {
# include "lua.h"
@@ -30,7 +31,7 @@ std::string pad(std::string s, size_t size = 16)
return s;
}
int main(int argc, const char **argv)
int main(int argc, char **argv)
{
vfunc zlib = [](strs &c, strs &l)
{
@@ -117,6 +118,19 @@ int main(int argc, const char **argv)
return "freetype";
};
vfunc SDL2 = [](strs &c, strs &l)
{
SDL_version compiled;
SDL_version linked;
SDL_VERSION(&compiled);
SDL_GetVersion(&linked);
c << (int)compiled.major << "." << (int)compiled.minor << "." << (int)compiled.patch;
l << (int)linked.major << "." << (int)linked.minor << "." << (int)linked.patch;
return "SDL2";
};
std::vector<vfunc> funcs;
funcs.push_back(zlib);
funcs.push_back(physfs);
@@ -128,6 +142,7 @@ int main(int argc, const char **argv)
funcs.push_back(vorbisfile);
funcs.push_back(mpg123);
funcs.push_back(freetype);
funcs.push_back(SDL2);
for (size_t i = 0; i < funcs.size(); ++i)
{