diff --git a/CMakeLists.txt b/CMakeLists.txt index e83a55e4..2b1d2a6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -193,6 +193,11 @@ link_directories ("${LIBLOADORDER_ROOT}/build" # System-Specific Settings ############################## +# If building on Travis, set a preprocessor definition. +IF ($ENV{TRAVIS}) + add_definitions (-DTRAVIS) +ENDIF () + # Settings when compiling for Windows. Since it's a Windows-only app this is always true, but useful to check for copy/paste into other projects. IF (CMAKE_SYSTEM_NAME MATCHES "Windows") add_definitions (-DUNICODE -D_UNICODE -DLIBLO_STATIC) diff --git a/src/tests/backend/game/test_game.h b/src/tests/backend/game/test_game.h index 29b294b5..c78b7800 100644 --- a/src/tests/backend/game/test_game.h +++ b/src/tests/backend/game/test_game.h @@ -28,6 +28,7 @@ along with LOOT. If not, see #include "backend/error.h" #include "backend/globals.h" #include "backend/game/game.h" + #include "tests/fixtures.h" class Game : public SkyrimTest {}; diff --git a/src/tests/fixtures.h b/src/tests/fixtures.h index c5cd09df..bf2150d5 100644 --- a/src/tests/fixtures.h +++ b/src/tests/fixtures.h @@ -29,11 +29,6 @@ along with LOOT. If not, see #include -#ifdef __GNUC__ // Workaround for GCC linking error. -#pragma message("GCC detected: Defining BOOST_NO_CXX11_SCOPED_ENUMS and BOOST_NO_SCOPED_ENUMS to avoid linking errors for boost::filesystem::copy_file().") -#define BOOST_NO_CXX11_SCOPED_ENUMS -#define BOOST_NO_SCOPED_ENUMS // For older versions. -#endif #include class GameTest : public ::testing::Test { diff --git a/src/tests/main.cpp b/src/tests/main.cpp index d69b226f..8dc21c59 100644 --- a/src/tests/main.cpp +++ b/src/tests/main.cpp @@ -22,6 +22,11 @@ . */ +#ifdef TRAVIS +#pragma message("This is a Travis build, so defining BOOST_NO_CXX11_SCOPED_ENUMS to avoid boost::filesystem::copy_file() linking errors.") +#define BOOST_NO_CXX11_SCOPED_ENUMS +#endif + #include "api/test_api.h" #include "backend/game/test_game.h" #include "backend/game/test_game_settings.h"