summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am4
-rw-r--r--src/main.cpp13
2 files changed, 17 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index a915c8c06..72f3edae3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -25,6 +25,10 @@ if USE_MUMBLE
manaplus_CXXFLAGS += -DUSE_MUMBLE
endif
+if USE_SDL2
+manaplus_CXXFLAGS += -DUSE_SDL2
+endif
+
if USE_INTERNALGUICHAN
manaplus_CXXFLAGS += -DUSE_INTERNALGUICHAN
manaplus_SOURCES += guichan/include/guichan/actionevent.hpp \
diff --git a/src/main.cpp b/src/main.cpp
index 55af95f4f..7bedd1b9d 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -20,6 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+
#include "main.h"
#include "client.h"
@@ -46,6 +47,18 @@
#include <windows.h>
#endif
+#include <SDL_version.h>
+
+#if SDL_VERSION_ATLEAST(2,0,0)
+#ifndef USE_SDL2
+#error using SDL2 headers but configure set to use SDL1.2
+#endif
+#else
+#ifdef USE_SDL2
+#error using SDL1.2 headers but configure set to use SDL2
+#endif
+#endif
+
#include "debug.h"
char *selfName = nullptr;