From c7463c5f6cd3d882a960eff2cbd414f33ddf0b32 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 9 Mar 2013 00:12:50 +0000 Subject: 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 --- src/server/worldserver/CMakeLists.txt | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'src/server/worldserver') 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 ) -- cgit v1.2.3