diff options
author | Nay <dnpd.dd@gmail.com> | 2013-03-09 00:12:50 +0000 |
---|---|---|
committer | Nay <dnpd.dd@gmail.com> | 2013-03-09 00:12:50 +0000 |
commit | c7463c5f6cd3d882a960eff2cbd414f33ddf0b32 (patch) | |
tree | ab23a6a592b381e6b0f2e63ba88fc1e38b90856a /src | |
parent | 2dbe3d6cfe2d174b5edf9fdb6720fee21c7009d2 (diff) |
Buildsystem: Add support for compiling with MinGW on Windows
Tested with:
- Windows 8 x64
- MySQL 5.5.30 win32
- OpenSSL 1.0.1c (32 bits)
- No PCH
- MinGW with GCC 4.7.0
TODO:
- Fix compile/link with PCH enabled
- Fix compile with WheatyExceptonionReport enabled (ignored for now)
- Fix compile of .rc files (ignored for now)
- Test with more platforms
Diffstat (limited to 'src')
-rw-r--r-- | src/server/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/server/authserver/CMakeLists.txt | 30 | ||||
-rw-r--r-- | src/server/collision/BoundingIntervalHierarchy.cpp | 8 | ||||
-rw-r--r-- | src/server/shared/Debugging/WheatyExceptionReport.cpp | 2 | ||||
-rw-r--r-- | src/server/shared/Debugging/WheatyExceptionReport.h | 2 | ||||
-rw-r--r-- | src/server/worldserver/CMakeLists.txt | 32 |
6 files changed, 51 insertions, 25 deletions
diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt index e8816ea8816..02fca56340f 100644 --- a/src/server/CMakeLists.txt +++ b/src/server/CMakeLists.txt @@ -12,7 +12,7 @@ # This to stop a few silly crashes that could have been avoided IF people # weren't doing some -O3 psychooptimizations etc. -if(CMAKE_COMPILER_IS_GNUCXX) +if(CMAKE_COMPILER_IS_GNUCXX AND NOT MINGW) add_definitions(-fno-delete-null-pointer-checks) endif() diff --git a/src/server/authserver/CMakeLists.txt b/src/server/authserver/CMakeLists.txt index 328369cb908..f7c4b9cb8ca 100644 --- a/src/server/authserver/CMakeLists.txt +++ b/src/server/authserver/CMakeLists.txt @@ -29,11 +29,18 @@ set(authserver_SRCS ) if( WIN32 ) -set(authserver_SRCS - ${authserver_SRCS} - ${sources_Debugging} + if ( MSVC ) + set(authserver_SRCS + ${authserver_SRCS} + ${sources_Debugging} authserver.rc -) + ) + else ( ) + set(authserver_SRCS + ${authserver_SRCS} + ${sources_Debugging} + ) + endif () endif() include_directories( @@ -76,10 +83,17 @@ target_link_libraries(authserver ) if( WIN32 ) - add_custom_command(TARGET authserver - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/authserver.conf.dist ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/ - ) + if ( MSVC ) + add_custom_command(TARGET authserver + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/authserver.conf.dist ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/ + ) + elseif ( MINGW ) + add_custom_command(TARGET authserver + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/authserver.conf.dist ${CMAKE_BINARY_DIR}/bin/ + ) + endif() endif() if( UNIX ) diff --git a/src/server/collision/BoundingIntervalHierarchy.cpp b/src/server/collision/BoundingIntervalHierarchy.cpp index 4c1f449da25..340d66ddaf0 100644 --- a/src/server/collision/BoundingIntervalHierarchy.cpp +++ b/src/server/collision/BoundingIntervalHierarchy.cpp @@ -18,12 +18,10 @@ #include "BoundingIntervalHierarchy.h" -#if defined __APPLE__ - #define isnan std::isnan -#elif defined __CYGWIN__ - #define isnan std::isnan -#elif defined _MSC_VER +#ifdef _MSC_VER #define isnan _isnan +#else + #define isnan std::isnan #endif void BIH::buildHierarchy(std::vector<uint32> &tempTree, buildData &dat, BuildStats &stats) diff --git a/src/server/shared/Debugging/WheatyExceptionReport.cpp b/src/server/shared/Debugging/WheatyExceptionReport.cpp index ea9ab096dcd..19db228913b 100644 --- a/src/server/shared/Debugging/WheatyExceptionReport.cpp +++ b/src/server/shared/Debugging/WheatyExceptionReport.cpp @@ -3,7 +3,7 @@ // MSDN Magazine, 2002 // FILE: WheatyExceptionReport.CPP //========================================== -#if PLATFORM == PLATFORM_WINDOWS +#if PLATFORM == PLATFORM_WINDOWS && not defined(__MINGW32__) #define WIN32_LEAN_AND_MEAN #pragma warning(disable:4996) #pragma warning(disable:4312) diff --git a/src/server/shared/Debugging/WheatyExceptionReport.h b/src/server/shared/Debugging/WheatyExceptionReport.h index 8ade80ca47b..684b10e9b9a 100644 --- a/src/server/shared/Debugging/WheatyExceptionReport.h +++ b/src/server/shared/Debugging/WheatyExceptionReport.h @@ -1,7 +1,7 @@ #ifndef _WHEATYEXCEPTIONREPORT_ #define _WHEATYEXCEPTIONREPORT_ -#if PLATFORM == PLATFORM_WINDOWS +#if PLATFORM == PLATFORM_WINDOWS && not defined(__MINGW32__) #include <dbghelp.h> diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt index 8c1350a7ca0..b7097be8e2a 100644 --- a/src/server/worldserver/CMakeLists.txt +++ b/src/server/worldserver/CMakeLists.txt @@ -29,11 +29,18 @@ set(worldserver_SRCS ) if( WIN32 ) - set(worldserver_SRCS - ${worldserver_SRCS} - ${sources_Debugging} - worldserver.rc - ) + if ( MSVC ) + set(worldserver_SRCS + ${worldserver_SRCS} + ${sources_Debugging} + worldserver.rc + ) + else ( ) + set(worldserver_SRCS + ${worldserver_SRCS} + ${sources_Debugging} + ) + endif () endif() include_directories( @@ -175,10 +182,17 @@ target_link_libraries(worldserver ) if( WIN32 ) - add_custom_command(TARGET worldserver - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/worldserver.conf.dist ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/ - ) + if ( MSVC ) + add_custom_command(TARGET worldserver + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/worldserver.conf.dist ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/ + ) + elseif ( MINGW ) + add_custom_command(TARGET worldserver + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/worldserver.conf.dist ${CMAKE_BINARY_DIR}/bin/ + ) + endif() endif() if( UNIX ) |