diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2013-03-22 18:19:53 +0100 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2013-03-22 19:17:08 +0100 |
commit | 4a30800cf16d403a7c25d78388e2822aa396ac86 (patch) | |
tree | 772753228bab7b0b4ba47e89580ed86de0ca098f /test | |
parent | 1406464f0ce0b804298e2ee034bdd8bc7856e0dc (diff) | |
download | colobot-4a30800cf16d403a7c25d78388e2822aa396ac86.tar.gz colobot-4a30800cf16d403a7c25d78388e2822aa396ac86.tar.bz2 colobot-4a30800cf16d403a7c25d78388e2822aa396ac86.zip |
Fixes for compiling on MSYS
* fixed SDL_main() and putenv() issues
* disabled desktop subdir for MSYS
* disabled building CBot_console for now
Diffstat (limited to 'test')
-rw-r--r-- | test/cbot/CMakeLists.txt | 2 | ||||
-rw-r--r-- | test/envs/opengl/light_test.cpp | 12 | ||||
-rw-r--r-- | test/envs/opengl/model_test.cpp | 12 | ||||
-rw-r--r-- | test/envs/opengl/texture_test.cpp | 12 | ||||
-rw-r--r-- | test/envs/opengl/transform_test.cpp | 12 | ||||
-rw-r--r-- | test/unit/CMakeLists.txt | 33 | ||||
-rw-r--r-- | test/unit/common/image_test.cpp | 2 |
7 files changed, 58 insertions, 27 deletions
diff --git a/test/cbot/CMakeLists.txt b/test/cbot/CMakeLists.txt index e864ed5..e087ea5 100644 --- a/test/cbot/CMakeLists.txt +++ b/test/cbot/CMakeLists.txt @@ -1,2 +1,2 @@ # CBot console interpreter -add_subdirectory(CBot_console) +#add_subdirectory(CBot_console) diff --git a/test/envs/opengl/light_test.cpp b/test/envs/opengl/light_test.cpp index b1e0151..d4635cc 100644 --- a/test/envs/opengl/light_test.cpp +++ b/test/envs/opengl/light_test.cpp @@ -1,5 +1,6 @@ #include "app/system.h" +#include "common/config.h" #include "common/logger.h" #include "common/image.h" @@ -7,8 +8,8 @@ #include "math/geometry.h" -#include <SDL/SDL.h> -#include <SDL/SDL_image.h> +#include <SDL.h> +#include <SDL_image.h> #include <unistd.h> #include <iostream> @@ -357,7 +358,10 @@ void MouseMove(int x, int y) ROTATION.x = ROTATION_BASE.x + (static_cast<float> (y - MOUSE_POS_BASE.y) / 600.0f) * Math::PI; } -int main(int argc, char *argv[]) +extern "C" +{ + +int SDL_MAIN_FUNC(int argc, char *argv[]) { CLogger logger; @@ -460,3 +464,5 @@ int main(int argc, char *argv[]) return 0; } + +} // extern "C" diff --git a/test/envs/opengl/model_test.cpp b/test/envs/opengl/model_test.cpp index 882b785..168eb32 100644 --- a/test/envs/opengl/model_test.cpp +++ b/test/envs/opengl/model_test.cpp @@ -1,5 +1,6 @@ #include "app/system.h" +#include "common/config.h" #include "common/logger.h" #include "common/image.h" @@ -8,8 +9,8 @@ #include "math/geometry.h" -#include <SDL/SDL.h> -#include <SDL/SDL_image.h> +#include <SDL.h> +#include <SDL_image.h> #include <unistd.h> #include <iostream> @@ -257,7 +258,10 @@ void KeyboardUp(SDLKey key) } } -int main(int argc, char *argv[]) +extern "C" +{ + +int SDL_MAIN_FUNC(int argc, char *argv[]) { CLogger logger; @@ -378,3 +382,5 @@ int main(int argc, char *argv[]) return 0; } + +} // extern "C" diff --git a/test/envs/opengl/texture_test.cpp b/test/envs/opengl/texture_test.cpp index b1f352c..5c27b43 100644 --- a/test/envs/opengl/texture_test.cpp +++ b/test/envs/opengl/texture_test.cpp @@ -1,3 +1,4 @@ +#include "common/config.h" #include "common/logger.h" #include "common/image.h" @@ -5,8 +6,8 @@ #include "math/geometry.h" -#include <SDL/SDL.h> -#include <SDL/SDL_image.h> +#include <SDL.h> +#include <SDL_image.h> #include <unistd.h> @@ -124,7 +125,10 @@ void Render(Gfx::CGLDevice *device) device->EndScene(); } -int main() +extern "C" +{ + +int SDL_MAIN_FUNC(int argc, char *argv[]) { CLogger logger; @@ -192,3 +196,5 @@ int main() return 0; } + +} // extern "C" diff --git a/test/envs/opengl/transform_test.cpp b/test/envs/opengl/transform_test.cpp index 04c73f7..02f9d83 100644 --- a/test/envs/opengl/transform_test.cpp +++ b/test/envs/opengl/transform_test.cpp @@ -1,5 +1,6 @@ #include "app/system.h" +#include "common/config.h" #include "common/logger.h" #include "common/image.h" #include "common/iman.h" @@ -8,8 +9,8 @@ #include "math/geometry.h" -#include <SDL/SDL.h> -#include <SDL/SDL_image.h> +#include <SDL.h> +#include <SDL_image.h> #include <unistd.h> #include <iostream> @@ -235,7 +236,10 @@ void MouseMove(int x, int y) ROTATION.x = ROTATION_BASE.x + (static_cast<float> (y - MOUSE_POS_BASE.y) / 600.0f) * Math::PI; } -int main(int argc, char *argv[]) +extern "C" +{ + +int SDL_MAIN_FUNC(int argc, char *argv[]) { CLogger logger; @@ -338,3 +342,5 @@ int main(int argc, char *argv[]) return 0; } + +} // extern "C" diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt index 34027b8..f3be01d 100644 --- a/test/unit/CMakeLists.txt +++ b/test/unit/CMakeLists.txt @@ -158,15 +158,8 @@ endif() set(OPTIONAL_LIBS "") if (${OPENAL_SOUND}) - if (${PLATFORM_WINDOWS}) - set(OPTIONAL_LIBS - OpenAL32 - ) - else() - set(OPTIONAL_LIBS - openal - ) - endif() + set(OPTIONAL_LIBS ${OPENAL_LIBRARY}) + set(OPTIONAL_INCLUDES ${OPENAL_INCLUDE_DIR}) endif() @@ -189,14 +182,28 @@ math/vector_test.cpp ${PLATFORM_TESTS} ) +# Local include_directories( -${CMAKE_CURRENT_BINARY_DIR} -${SRC_DIR} -${GTEST_INCLUDE_DIR} -${GMOCK_INCLUDE_DIR} . common math +${SRC_DIR} +${CMAKE_CURRENT_BINARY_DIR} +) + +# System +include_directories( +SYSTEM +${GTEST_INCLUDE_DIR} +${GMOCK_INCLUDE_DIR} +${SDL_INCLUDE_DIR} +${SDLIMAGE_INCLUDE_DIR} +${SDLTTF_INCLUDE_DIR} +${PNG_INCLUDE_DIRS} +${GLEW_INCLUDE_PATH} +${Boost_INCLUDE_DIRS} +${OPTIONAL_INCLUDE_DIRS} +${LIBSNDFILE_INCLUDE_DIR} ) set(LIBS diff --git a/test/unit/common/image_test.cpp b/test/unit/common/image_test.cpp index 2a8d5e4..2b20a17 100644 --- a/test/unit/common/image_test.cpp +++ b/test/unit/common/image_test.cpp @@ -1,6 +1,6 @@ #include "common/image.h" -#include <SDL/SDL.h> +#include <SDL.h> #include <stdio.h> /* For now, just a simple test: loading a file from image |