Fix more SDL_main issues

- Always include SDL2/SDL_main.h in all tests to handle main() correctly
- Link all tests with SDL2pp (and thus with libSDL2main)
This commit is contained in:
Dmitry Marakasov 2016-01-05 17:16:05 +03:00
parent 0355e817fc
commit 7dd543053c
7 changed files with 11 additions and 0 deletions

View File

@ -29,6 +29,7 @@ FOREACH(HEADER ${LIBRARY_HEADERS})
STRING(REGEX REPLACE [^a-zA-Z0-9] _ HEADER_NORMALIZED ${HEADER})
CONFIGURE_FILE(header_test.cc.in ${HEADER_NORMALIZED}_test.cc)
ADD_EXECUTABLE(${HEADER_NORMALIZED}_test ${HEADER_NORMALIZED}_test.cc)
TARGET_LINK_LIBRARIES(${HEADER_NORMALIZED}_test SDL2pp)
ENDFOREACH(HEADER ${TESTS})
FOREACH(TEST ${CLI_TESTS})

View File

@ -1,3 +1,4 @@
#include <SDL2/SDL_main.h>
#include <@HEADER@>
int main(int, char*[]) {

View File

@ -1,3 +1,4 @@
#include <SDL2/SDL_main.h>
#include <SDL2/SDL_error.h>
#include <SDL2pp/Exception.hh>

View File

@ -1,5 +1,7 @@
#include <string>
#include <SDL2/SDL_main.h>
#include <SDL2pp/Optional.hh>
#include "testing.h"

View File

@ -1,3 +1,5 @@
#include <SDL2/SDL_main.h>
#include <SDL2pp/Point.hh>
#include <SDL2pp/Rect.hh>

View File

@ -1,3 +1,5 @@
#include <SDL2/SDL_main.h>
#include <SDL2pp/Point.hh>
#include <SDL2pp/Rect.hh>

View File

@ -1,5 +1,7 @@
#include <vector>
#include <SDL2/SDL_main.h>
#include <SDL2pp/Exception.hh>
#include <SDL2pp/ContainerRWops.hh>
#include <SDL2pp/StreamRWops.hh>