diff options
-rw-r--r-- | cmake/compiler/mingw/settings.cmake | 27 | ||||
-rw-r--r-- | cmake/platform/win/settings.cmake | 6 | ||||
-rw-r--r-- | cmake/stack_direction.c | 31 | ||||
-rw-r--r-- | dep/acelite/ace-v6.1.4_hotfix1.diff (renamed from dep/acelite/6.1.4_tc_changes.diff) | 0 | ||||
-rw-r--r-- | dep/acelite/ace-v6.1.4_hotfix2.diff | 15 | ||||
-rw-r--r-- | dep/acelite/ace/CMakeLists.txt | 4 | ||||
-rw-r--r-- | dep/g3dlite/G3D-v8.0_hotfix6.diff | 103 | ||||
-rw-r--r-- | dep/g3dlite/include/G3D/platform.h | 5 | ||||
-rw-r--r-- | dep/g3dlite/source/FileSystem.cpp | 7 | ||||
-rw-r--r-- | dep/g3dlite/source/RegistryUtil.cpp | 9 | ||||
-rw-r--r-- | dep/g3dlite/source/System.cpp | 10 | ||||
-rw-r--r-- | dep/recastnavigation/Detour/DetourNavMesh.h | 2 | ||||
-rw-r--r-- | dep/recastnavigation/recast_hotfix1.diff | 13 | ||||
-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 |
19 files changed, 274 insertions, 34 deletions
diff --git a/cmake/compiler/mingw/settings.cmake b/cmake/compiler/mingw/settings.cmake new file mode 100644 index 00000000000..68156bd0b6b --- /dev/null +++ b/cmake/compiler/mingw/settings.cmake @@ -0,0 +1,27 @@ +# set up output paths for executable binaries (.exe-files, and .dll-files on DLL-capable platforms) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + +# Set build-directive (used in core to tell which buildtype we used) +add_definitions(-D_BUILD_DIRECTIVE=\\"${CMAKE_BUILD_TYPE}\\") + +if(PLATFORM EQUAL 32) + # Required on 32-bit systems to enable SSE2 (standard on x64) + set(SSE_FLAGS "-msse2 -mfpmath=sse") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SSE_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SSE_FLAGS}") +endif() +add_definitions(-DHAVE_SSE2 -D__SSE2__) +message(STATUS "GCC: SFMT enabled, SSE2 flags forced") + +if( WITH_WARNINGS ) + set(WARNING_FLAGS "-W -Wall -Wextra -Winit-self -Winvalid-pch -Wfatal-errors") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} -Woverloaded-virtual") + message(STATUS "GCC: All warnings enabled") +endif() + +if( WITH_COREDEBUG ) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3") + message(STATUS "GCC: Debug-flags set (-g3)") +endif() diff --git a/cmake/platform/win/settings.cmake b/cmake/platform/win/settings.cmake index b66eb2da7bb..c0f724922e3 100644 --- a/cmake/platform/win/settings.cmake +++ b/cmake/platform/win/settings.cmake @@ -25,4 +25,8 @@ endif() # endif() #endif() -include(${CMAKE_SOURCE_DIR}/cmake/compiler/msvc/settings.cmake) +if ( MSVC ) + include(${CMAKE_SOURCE_DIR}/cmake/compiler/msvc/settings.cmake) +elseif ( MINGW ) + include(${CMAKE_SOURCE_DIR}/cmake/compiler/mingw/settings.cmake) +endif() diff --git a/cmake/stack_direction.c b/cmake/stack_direction.c new file mode 100644 index 00000000000..11bcf803bfa --- /dev/null +++ b/cmake/stack_direction.c @@ -0,0 +1,31 @@ +/* Copyright (C) 2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + +/* Check stack direction (0-down, 1-up) */ +int f(int *a) +{ + int b; + return(&b > a)?1:0; +} +/* + Prevent compiler optimizations by calling function + through pointer. +*/ +volatile int (*ptr_f)(int *) = f; +int main() +{ + int a; + return ptr_f(&a); +}
\ No newline at end of file diff --git a/dep/acelite/6.1.4_tc_changes.diff b/dep/acelite/ace-v6.1.4_hotfix1.diff index 15b76eb29ce..15b76eb29ce 100644 --- a/dep/acelite/6.1.4_tc_changes.diff +++ b/dep/acelite/ace-v6.1.4_hotfix1.diff diff --git a/dep/acelite/ace-v6.1.4_hotfix2.diff b/dep/acelite/ace-v6.1.4_hotfix2.diff new file mode 100644 index 00000000000..4eeca2d1912 --- /dev/null +++ b/dep/acelite/ace-v6.1.4_hotfix2.diff @@ -0,0 +1,15 @@ +diff --git a/dep/acelite/ace/CMakeLists.txt b/dep/acelite/ace/CMakeLists.txt +index eb0f6dd..1f9ffa6 100644 +--- a/dep/acelite/ace/CMakeLists.txt ++++ b/dep/acelite/ace/CMakeLists.txt +@@ -341,6 +341,10 @@ add_library(ace SHARED + ${ace_PCH_SRC} + ) + ++if (MINGW) # GCC ignores "#prama comment" ++ target_link_libraries(ace ws2_32 iphlpapi netapi32 mswsock) ++endif() ++ + # Generate precompiled header + if( USE_COREPCH ) + add_cxx_pch(ace ${ace_PCH_HDR} ${ace_PCH_SRC}) diff --git a/dep/acelite/ace/CMakeLists.txt b/dep/acelite/ace/CMakeLists.txt index eb0f6dda5a7..1f9ffa622a0 100644 --- a/dep/acelite/ace/CMakeLists.txt +++ b/dep/acelite/ace/CMakeLists.txt @@ -341,6 +341,10 @@ add_library(ace SHARED ${ace_PCH_SRC} ) +if (MINGW) # GCC ignores "#prama comment" + target_link_libraries(ace ws2_32 iphlpapi netapi32 mswsock) +endif() + # Generate precompiled header if( USE_COREPCH ) add_cxx_pch(ace ${ace_PCH_HDR} ${ace_PCH_SRC}) diff --git a/dep/g3dlite/G3D-v8.0_hotfix6.diff b/dep/g3dlite/G3D-v8.0_hotfix6.diff new file mode 100644 index 00000000000..f22c26d4a7e --- /dev/null +++ b/dep/g3dlite/G3D-v8.0_hotfix6.diff @@ -0,0 +1,103 @@ +diff --git a/dep/g3dlite/include/G3D/platform.h b/dep/g3dlite/include/G3D/platform.h +index 614c0ed..65616f0 100644 +--- a/dep/g3dlite/include/G3D/platform.h ++++ b/dep/g3dlite/include/G3D/platform.h +@@ -51,6 +51,11 @@ + + #ifdef _MSC_VER + #define G3D_WIN32 ++#elif defined(__MINGW32__) ++ #define G3D_WIN32 ++ #undef __MSVCRT_VERSION__ ++ #define __MSVCRT_VERSION__ 0x0601 ++ #include <windows.h> + #elif defined(__FreeBSD__) || defined(__OpenBSD__) + #define G3D_FREEBSD + #define G3D_LINUX +diff --git a/dep/g3dlite/source/FileSystem.cpp b/dep/g3dlite/source/FileSystem.cpp +index 76a3611..f082937 100644 +--- a/dep/g3dlite/source/FileSystem.cpp ++++ b/dep/g3dlite/source/FileSystem.cpp +@@ -25,8 +25,11 @@ + + // Needed for _findfirst + # include <io.h> +- +-#define stat64 _stat64 ++# ifdef __MINGW32__ ++# define stat64 stat ++# else ++# define stat64 _stat64 ++# endif + #else + # include <dirent.h> + # include <fnmatch.h> +diff --git a/dep/g3dlite/source/RegistryUtil.cpp b/dep/g3dlite/source/RegistryUtil.cpp +index fc4cebc..7c9e56f 100644 +--- a/dep/g3dlite/source/RegistryUtil.cpp ++++ b/dep/g3dlite/source/RegistryUtil.cpp +@@ -16,6 +16,15 @@ + #include "G3D/RegistryUtil.h" + #include "G3D/System.h" + ++#ifdef __MINGW32__ ++# ifndef HKEY_PERFORMANCE_TEXT ++# define HKEY_PERFORMANCE_TEXT ((HKEY)((LONG)0x80000050)) ++# endif ++# ifndef HKEY_PERFORMANCE_NLSTEXT ++# define HKEY_PERFORMANCE_NLSTEXT ((HKEY)((LONG)0x80000060)) ++# endif ++#endif ++ + namespace G3D { + + // static helpers +diff --git a/dep/g3dlite/source/System.cpp b/dep/g3dlite/source/System.cpp +index f6b0e03..281104d 100644 +--- a/dep/g3dlite/source/System.cpp ++++ b/dep/g3dlite/source/System.cpp +@@ -564,7 +564,7 @@ void System::getStandardProcessorExtensions() { + #endif + } + +-#if defined(G3D_WIN32) && !defined(G3D_64BIT) /* G3DFIX: Don't check if on 64-bit Windows platforms */ ++#if defined(G3D_WIN32) && !defined(G3D_64BIT) && !defined(__MINGW32__) /* G3DFIX: Don't check if on 64-bit Windows platforms or using MinGW */ + #pragma message("Port System::memcpy SIMD to all platforms") + /** Michael Herf's fast memcpy */ + void memcpyMMX(void* dst, const void* src, int nbytes) { +@@ -615,7 +615,7 @@ void memcpyMMX(void* dst, const void* src, int nbytes) { + #endif + + void System::memcpy(void* dst, const void* src, size_t numBytes) { +-#if defined(G3D_WIN32) && !defined(G3D_64BIT) /* G3DFIX: Don't check if on 64-bit Windows platforms */ ++#if defined(G3D_WIN32) && !defined(G3D_64BIT) && !defined(__MINGW32__) /* G3DFIX: Don't check if on 64-bit Windows platforms or using MinGW */ + memcpyMMX(dst, src, numBytes); + #else + ::memcpy(dst, src, numBytes); +@@ -625,7 +625,7 @@ void System::memcpy(void* dst, const void* src, size_t numBytes) { + + /** Michael Herf's fastest memset. n32 must be filled with the same + character repeated. */ +-#if defined(G3D_WIN32) && !defined(G3D_64BIT) /* G3DFIX: Don't check if on 64-bit Windows platforms */ ++#if defined(G3D_WIN32) && !defined(G3D_64BIT) && !defined(__MINGW32__) /* G3DFIX: Don't check if on 64-bit Windows platforms or using MinGW */ + #pragma message("Port System::memfill SIMD to all platforms") + + // On x86 processors, use MMX +@@ -664,7 +664,7 @@ void memfill(void *dst, int n32, unsigned long i) { + + + void System::memset(void* dst, uint8 value, size_t numBytes) { +-#if defined(G3D_WIN32) && !defined(G3D_64BIT) /* G3DFIX: Don't check if on 64-bit Windows platforms */ ++#if defined(G3D_WIN32) && !defined(G3D_64BIT) && !defined(__MINGW32__) /* G3DFIX: Don't check if on 64-bit Windows platforms or using MinGW */ + uint32 v = value; + v = v + (v << 8) + (v << 16) + (v << 24); + G3D::memfill(dst, v, numBytes); +@@ -1696,7 +1696,7 @@ std::string System::currentDateString() { + + // VC on Intel + void System::cpuid(CPUIDFunction func, uint32& areg, uint32& breg, uint32& creg, uint32& dreg) { +-#if !defined(G3D_64BIT) /* G3DFIX: Don't check if on 64-bit platform */ ++#if !defined(G3D_64BIT) && !defined(__MINGW32__) /* G3DFIX: Don't check if on 64-bit platforms or using MinGW */ + // Can't copy from assembler direct to a function argument (which is on the stack) in VC. + uint32 a,b,c,d; + diff --git a/dep/g3dlite/include/G3D/platform.h b/dep/g3dlite/include/G3D/platform.h index 614c0ed7cad..65616f0b53e 100644 --- a/dep/g3dlite/include/G3D/platform.h +++ b/dep/g3dlite/include/G3D/platform.h @@ -51,6 +51,11 @@ #ifdef _MSC_VER #define G3D_WIN32 +#elif defined(__MINGW32__) + #define G3D_WIN32 + #undef __MSVCRT_VERSION__ + #define __MSVCRT_VERSION__ 0x0601 + #include <windows.h> #elif defined(__FreeBSD__) || defined(__OpenBSD__) #define G3D_FREEBSD #define G3D_LINUX diff --git a/dep/g3dlite/source/FileSystem.cpp b/dep/g3dlite/source/FileSystem.cpp index 76a361162c9..f082937a908 100644 --- a/dep/g3dlite/source/FileSystem.cpp +++ b/dep/g3dlite/source/FileSystem.cpp @@ -25,8 +25,11 @@ // Needed for _findfirst # include <io.h> - -#define stat64 _stat64 +# ifdef __MINGW32__ +# define stat64 stat +# else +# define stat64 _stat64 +# endif #else # include <dirent.h> # include <fnmatch.h> diff --git a/dep/g3dlite/source/RegistryUtil.cpp b/dep/g3dlite/source/RegistryUtil.cpp index fc4cebc2ee5..7c9e56f79ae 100644 --- a/dep/g3dlite/source/RegistryUtil.cpp +++ b/dep/g3dlite/source/RegistryUtil.cpp @@ -16,6 +16,15 @@ #include "G3D/RegistryUtil.h" #include "G3D/System.h" +#ifdef __MINGW32__ +# ifndef HKEY_PERFORMANCE_TEXT +# define HKEY_PERFORMANCE_TEXT ((HKEY)((LONG)0x80000050)) +# endif +# ifndef HKEY_PERFORMANCE_NLSTEXT +# define HKEY_PERFORMANCE_NLSTEXT ((HKEY)((LONG)0x80000060)) +# endif +#endif + namespace G3D { // static helpers diff --git a/dep/g3dlite/source/System.cpp b/dep/g3dlite/source/System.cpp index f6b0e038f27..281104d39f1 100644 --- a/dep/g3dlite/source/System.cpp +++ b/dep/g3dlite/source/System.cpp @@ -564,7 +564,7 @@ void System::getStandardProcessorExtensions() { #endif } -#if defined(G3D_WIN32) && !defined(G3D_64BIT) /* G3DFIX: Don't check if on 64-bit Windows platforms */ +#if defined(G3D_WIN32) && !defined(G3D_64BIT) && !defined(__MINGW32__) /* G3DFIX: Don't check if on 64-bit Windows platforms or using MinGW */ #pragma message("Port System::memcpy SIMD to all platforms") /** Michael Herf's fast memcpy */ void memcpyMMX(void* dst, const void* src, int nbytes) { @@ -615,7 +615,7 @@ void memcpyMMX(void* dst, const void* src, int nbytes) { #endif void System::memcpy(void* dst, const void* src, size_t numBytes) { -#if defined(G3D_WIN32) && !defined(G3D_64BIT) /* G3DFIX: Don't check if on 64-bit Windows platforms */ +#if defined(G3D_WIN32) && !defined(G3D_64BIT) && !defined(__MINGW32__) /* G3DFIX: Don't check if on 64-bit Windows platforms or using MinGW */ memcpyMMX(dst, src, numBytes); #else ::memcpy(dst, src, numBytes); @@ -625,7 +625,7 @@ void System::memcpy(void* dst, const void* src, size_t numBytes) { /** Michael Herf's fastest memset. n32 must be filled with the same character repeated. */ -#if defined(G3D_WIN32) && !defined(G3D_64BIT) /* G3DFIX: Don't check if on 64-bit Windows platforms */ +#if defined(G3D_WIN32) && !defined(G3D_64BIT) && !defined(__MINGW32__) /* G3DFIX: Don't check if on 64-bit Windows platforms or using MinGW */ #pragma message("Port System::memfill SIMD to all platforms") // On x86 processors, use MMX @@ -664,7 +664,7 @@ void memfill(void *dst, int n32, unsigned long i) { void System::memset(void* dst, uint8 value, size_t numBytes) { -#if defined(G3D_WIN32) && !defined(G3D_64BIT) /* G3DFIX: Don't check if on 64-bit Windows platforms */ +#if defined(G3D_WIN32) && !defined(G3D_64BIT) && !defined(__MINGW32__) /* G3DFIX: Don't check if on 64-bit Windows platforms or using MinGW */ uint32 v = value; v = v + (v << 8) + (v << 16) + (v << 24); G3D::memfill(dst, v, numBytes); @@ -1696,7 +1696,7 @@ std::string System::currentDateString() { // VC on Intel void System::cpuid(CPUIDFunction func, uint32& areg, uint32& breg, uint32& creg, uint32& dreg) { -#if !defined(G3D_64BIT) /* G3DFIX: Don't check if on 64-bit platform */ +#if !defined(G3D_64BIT) && !defined(__MINGW32__) /* G3DFIX: Don't check if on 64-bit platforms or using MinGW */ // Can't copy from assembler direct to a function argument (which is on the stack) in VC. uint32 a,b,c,d; diff --git a/dep/recastnavigation/Detour/DetourNavMesh.h b/dep/recastnavigation/Detour/DetourNavMesh.h index 52d2c505ec9..99e30c75142 100644 --- a/dep/recastnavigation/Detour/DetourNavMesh.h +++ b/dep/recastnavigation/Detour/DetourNavMesh.h @@ -21,7 +21,7 @@ #include "DetourAlloc.h" -#ifdef WIN32 +#if defined(WIN32) && not defined(__MINGW32__) typedef unsigned __int64 uint64; #else #include <stdint.h> diff --git a/dep/recastnavigation/recast_hotfix1.diff b/dep/recastnavigation/recast_hotfix1.diff new file mode 100644 index 00000000000..6e8fc3397e3 --- /dev/null +++ b/dep/recastnavigation/recast_hotfix1.diff @@ -0,0 +1,13 @@ +diff --git a/dep/recastnavigation/Detour/DetourNavMesh.h b/dep/recastnavigation/Detour/DetourNavMesh.h +index 52d2c50..99e30c7 100644 +--- a/dep/recastnavigation/Detour/DetourNavMesh.h ++++ b/dep/recastnavigation/Detour/DetourNavMesh.h +@@ -21,7 +21,7 @@ + + #include "DetourAlloc.h" + +-#ifdef WIN32 ++#if defined(WIN32) && not defined(__MINGW32__) + typedef unsigned __int64 uint64; + #else + #include <stdint.h> 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 ) |