diff options
author | Erik Schilling <ablu.erikschilling@googlemail.com> | 2013-02-03 20:42:11 +0100 |
---|---|---|
committer | Erik Schilling <ablu.erikschilling@googlemail.com> | 2013-02-03 22:45:28 +0100 |
commit | 59a7bc4694a93aae668f2d68409a420a12e8d9fb (patch) | |
tree | f6202e913064d28aea7f63dde37ecd39050b6a96 | |
parent | 19d932391160ac75a05cda7f657ce2a271491935 (diff) | |
download | manaserv-59a7bc4694a93aae668f2d68409a420a12e8d9fb.tar.gz manaserv-59a7bc4694a93aae668f2d68409a420a12e8d9fb.tar.bz2 manaserv-59a7bc4694a93aae668f2d68409a420a12e8d9fb.tar.xz manaserv-59a7bc4694a93aae668f2d68409a420a12e8d9fb.zip |
Modifications to allow crosscompiling with mingw
Reviewed-by: bjorn.
-rw-r--r-- | CMake/Modules/FindSigC++.cmake | 14 | ||||
-rw-r--r-- | CMake/Modules/LibFindMacros.cmake | 2 | ||||
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/CMakeLists.txt | 8 | ||||
-rw-r--r-- | src/account-server/main-account.cpp | 4 | ||||
-rw-r--r-- | src/common/winver.h | 6 | ||||
-rw-r--r-- | src/common/winver.h.in | 6 | ||||
-rw-r--r-- | src/game-server/main-game.cpp | 1 | ||||
-rw-r--r-- | src/net/messagein.cpp | 1 | ||||
-rw-r--r-- | src/net/messageout.cpp | 1 |
10 files changed, 32 insertions, 13 deletions
diff --git a/CMake/Modules/FindSigC++.cmake b/CMake/Modules/FindSigC++.cmake index 35687d5b..45796e52 100644 --- a/CMake/Modules/FindSigC++.cmake +++ b/CMake/Modules/FindSigC++.cmake @@ -8,27 +8,27 @@ include(LibFindMacros) # Use pkg-config to get hints about paths -libfind_pkg_check_modules(SigC++_PKGCONF sigc++-2.0) +libfind_pkg_check_modules(SIGC++_PKGCONF sigc++-2.0) # Main include dir -find_path(SigC++_INCLUDE_DIR +find_path(SIGC++_INCLUDE_DIR NAMES sigc++/sigc++.h PATHS ${SigC++_PKGCONF_INCLUDE_DIRS} PATH_SUFFIXES sigc++-2.0 ) # Glib-related libraries also use a separate config header, which is in lib dir -find_path(SigC++Config_INCLUDE_DIR +find_path(SIGC++Config_INCLUDE_DIR NAMES sigc++config.h PATHS ${SigC++_PKGCONF_INCLUDE_DIRS} /usr PATH_SUFFIXES lib/sigc++-2.0/include ) -libfind_library(SigC++ sigc 2.0) +libfind_library(SIGC++ sigc 2.0) # Set the include dir variables and the libraries and let libfind_process do # the rest. NOTE: Singular variables for this library, plural for libraries # this this lib depends on. -set(SigC++_PROCESS_INCLUDES SigC++_INCLUDE_DIR SigC++Config_INCLUDE_DIR) -set(SigC++_PROCESS_LIBS SigC++_LIBRARY) -libfind_process(SigC++) +set(SIGC++_PROCESS_INCLUDES SIGC++_INCLUDE_DIR SIGC++Config_INCLUDE_DIR) +set(SIGC++_PROCESS_LIBS SIGC++_LIBRARIES) +libfind_process(SIGC++) diff --git a/CMake/Modules/LibFindMacros.cmake b/CMake/Modules/LibFindMacros.cmake index 69975c51..bb387929 100644 --- a/CMake/Modules/LibFindMacros.cmake +++ b/CMake/Modules/LibFindMacros.cmake @@ -91,7 +91,7 @@ macro(libfind_library PREFIX basename) string(REGEX REPLACE "\\." "_" TMP ${${PREFIX}_LIBNAMES}) set(${PREFIX}_LIBNAMES ${${PREFIX}_LIBNAMES} ${TMP}) endif(${ARGC} GREATER 2) - find_library(${PREFIX}_LIBRARY + find_library(${PREFIX}_LIBRARIES NAMES ${${PREFIX}_LIBNAMES} PATHS ${${PREFIX}_PKGCONF_LIBRARY_DIRS} ) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d601e95..30124fb5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,7 +45,7 @@ IF (WIN32) LIST(GET _VERSION 1 VER_MINOR) LIST(GET _VERSION 2 VER_RELEASE) LIST(GET _VERSION 3 VER_BUILD) - CONFIGURE_FILE(src/winver.h.in src/winver.h) + CONFIGURE_FILE(src/common/winver.h.in src/common/winver.h) ELSE (WIN32) SET(PKG_DATADIR ${CMAKE_INSTALL_PREFIX}/share/manaserv) SET(LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1d06c5d8..c8752fbc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -37,7 +37,7 @@ IF (MINGW) "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -O coff -o <OBJECT> <SOURCE>") ENDIF() -SET(FLAGS "-DPACKAGE_VERSION=\\\"${VERSION}\\\"") +SET(FLAGS "${FLAGS} -DPACKAGE_VERSION=\\\"${VERSION}\\\"") SET(FLAGS "${FLAGS} -DPKG_DATADIR=\\\"${PKG_DATADIR}/\\\"") SET(FLAGS "${FLAGS} -DLOCALEDIR=\\\"${LOCALEDIR}/\\\"") @@ -94,8 +94,8 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ${PHYSFS_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR} - ${SigC++_INCLUDE_DIR} - ${SigC++Config_INCLUDE_DIR} + ${SIGC++_INCLUDE_DIR} + ${SIGC++Config_INCLUDE_DIR} ) # Fix some stuff that gets not hidden by mainline modules @@ -319,7 +319,7 @@ FOREACH(program ${PROGRAMS}) ${PHYSFS_LIBRARY} ${LIBXML2_LIBRARIES} ${ZLIB_LIBRARIES} - ${SigC++_LIBRARIES} + ${SIGC++_LIBRARIES} ${OPTIONAL_LIBRARIES} ${EXTRA_LIBRARIES}) INSTALL(TARGETS ${program} RUNTIME DESTINATION ${PKG_BINDIR}) diff --git a/src/account-server/main-account.cpp b/src/account-server/main-account.cpp index ab4df75e..db69fe69 100644 --- a/src/account-server/main-account.cpp +++ b/src/account-server/main-account.cpp @@ -23,6 +23,10 @@ #include "../config.h" #endif +#ifdef __MINGW32__ +#include "common/winver.h" +#endif + #include "account-server/accounthandler.h" #include "account-server/serverhandler.h" #include "account-server/storage.h" diff --git a/src/common/winver.h b/src/common/winver.h new file mode 100644 index 00000000..03a0c215 --- /dev/null +++ b/src/common/winver.h @@ -0,0 +1,6 @@ +/* VERSION DEFINITIONS */ +#define VER_MAJOR 0 +#define VER_MINOR 1 +#define VER_RELEASE 0 +#define VER_BUILD 0 +#define PACKAGE_VERSION "0.1.0.0" diff --git a/src/common/winver.h.in b/src/common/winver.h.in new file mode 100644 index 00000000..fb0aac2c --- /dev/null +++ b/src/common/winver.h.in @@ -0,0 +1,6 @@ +/* VERSION DEFINITIONS */ +#define VER_MAJOR ${VER_MAJOR} +#define VER_MINOR ${VER_MINOR} +#define VER_RELEASE ${VER_RELEASE} +#define VER_BUILD ${VER_BUILD} +#define PACKAGE_VERSION "${VERSION}" diff --git a/src/game-server/main-game.cpp b/src/game-server/main-game.cpp index 5814f0bc..f76189f9 100644 --- a/src/game-server/main-game.cpp +++ b/src/game-server/main-game.cpp @@ -54,6 +54,7 @@ #ifdef __MINGW32__ #include <windows.h> +#include "common/winver.h" #define usleep(usec) (Sleep ((usec) / 1000), 0) #endif diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp index b797f0a0..ce1be488 100644 --- a/src/net/messagein.cpp +++ b/src/net/messagein.cpp @@ -27,6 +27,7 @@ #ifndef USE_NATIVE_DOUBLE #include <sstream> #endif +#include <stdint.h> #include "net/messagein.h" #include "utils/logger.h" diff --git a/src/net/messageout.cpp b/src/net/messageout.cpp index 00bb623b..af305a6e 100644 --- a/src/net/messageout.cpp +++ b/src/net/messageout.cpp @@ -28,6 +28,7 @@ #include <limits> #include <sstream> #endif +#include <stdint.h> #include <string> #include <enet/enet.h> |