Browse Source

Adjustments required for building with MingW-w64

Rokas Kupstys 8 years ago
parent
commit
57f047f030

+ 1 - 1
Build/CMake/Modules/AtomicDesktop.cmake

@@ -1,7 +1,7 @@
 set(ATOMIC_DESKTOP TRUE)
 set(ATOMIC_DESKTOP TRUE)
 
 
 # Check whether the CEF submodule is available
 # Check whether the CEF submodule is available
-if (NOT DEFINED ATOMIC_WEBVIEW AND EXISTS ${ATOMIC_SOURCE_DIR}/Submodules/CEF)
+if (NOT MINGW AND NOT DEFINED ATOMIC_WEBVIEW AND EXISTS ${ATOMIC_SOURCE_DIR}/Submodules/CEF)
     #Check if CEF got pulled by looking if the foldes is empty
     #Check if CEF got pulled by looking if the foldes is empty
     file(GLOB CEF_FILES ${ATOMIC_SOURCE_DIR}/Submodules/CEF/*)
     file(GLOB CEF_FILES ${ATOMIC_SOURCE_DIR}/Submodules/CEF/*)
 
 

+ 1 - 1
Source/Atomic/Environment/ProcSky.h

@@ -22,7 +22,7 @@
 
 
 #pragma once
 #pragma once
 
 
-#if defined(_WIN32) || defined(_WIN64)
+#if _MSC_VER
 #define fmax max
 #define fmax max
 #define fmin min
 #define fmin min
 #endif
 #endif

+ 3 - 0
Source/ThirdParty/Civetweb/CMakeLists.txt

@@ -36,6 +36,9 @@ if (WIN32)
             add_definitions (-D_TIMESPEC_DEFINED)
             add_definitions (-D_TIMESPEC_DEFINED)
         endif ()
         endif ()
     endif ()
     endif ()
+    # ATOMIC BEGIN
+    set(LIBS ws2_32.lib)
+    # ATOMIC END
 elseif (APPLE AND (NOT IOS OR IPHONEOS_DEPLOYMENT_TARGET STREQUAL "" OR NOT IPHONEOS_DEPLOYMENT_TARGET VERSION_LESS 10.0))    # We cheat a little bit here with a hard-coded check because iOS 10.3 SDK when targeting 9.3 has strong symbol for iPhoneOS archs but weak symbol for iPhoneSimulator archs
 elseif (APPLE AND (NOT IOS OR IPHONEOS_DEPLOYMENT_TARGET STREQUAL "" OR NOT IPHONEOS_DEPLOYMENT_TARGET VERSION_LESS 10.0))    # We cheat a little bit here with a hard-coded check because iOS 10.3 SDK when targeting 9.3 has strong symbol for iPhoneOS archs but weak symbol for iPhoneSimulator archs
     include (CheckLibraryExists)
     include (CheckLibraryExists)
     check_library_exists (c clock_gettime "" FOUND_CLOCK_GETTIME_IN_C)
     check_library_exists (c clock_gettime "" FOUND_CLOCK_GETTIME_IN_C)

+ 20 - 0
Source/ThirdParty/Poco/Foundation/include/Poco/FPEnvironment_WIN32.h

@@ -27,6 +27,26 @@
 
 
 namespace Poco {
 namespace Poco {
 
 
+// ATOMIC BEGIN
+#if __MINGW32__ || __MINW64__
+#	define RC_DOWN _RC_DOWN
+#	define RC_UP _RC_UP
+#	define RC_NEAR _RC_NEAR
+#	define RC_CHOP _RC_CHOP
+
+#	define SW_ZERODIVIDE _EM_ZERODIVIDE
+#	define SW_INEXACT _EM_INEXACT
+#	define SW_OVERFLOW _EM_OVERFLOW
+#	define SW_UNDERFLOW _EM_UNDERFLOW
+#	define SW_INVALID _EM_INVALID
+
+#	define MCW_DN _MCW_DN
+#	define MCW_EM _MCW_EM
+#	define MCW_IC _MCW_IC
+#	define MCW_RC _MCW_RC
+#	define MCW_PC _MCW_PC
+#endif
+// ATOMIC END
 
 
 class Foundation_API FPEnvironmentImpl
 class Foundation_API FPEnvironmentImpl
 {
 {

+ 5 - 2
Source/ThirdParty/WebSocketPP/include/websocketpp/common/thread.hpp

@@ -36,11 +36,14 @@
 #if defined _WEBSOCKETPP_CPP11_INTERNAL_ && !defined _WEBSOCKETPP_NO_CPP11_THREAD_
 #if defined _WEBSOCKETPP_CPP11_INTERNAL_ && !defined _WEBSOCKETPP_NO_CPP11_THREAD_
     // MinGW by default does not support C++11 thread/mutex so even if the
     // MinGW by default does not support C++11 thread/mutex so even if the
     // internal check for C++11 passes, ignore it if we are on MinGW
     // internal check for C++11 passes, ignore it if we are on MinGW
-    #if (!defined(__MINGW32__) && !defined(__MINGW64__))
+// ATOMIC BEGIN
+// Reasonably new MingW supports these features.
+//    #if (!defined(__MINGW32__) && !defined(__MINGW64__))
         #ifndef _WEBSOCKETPP_CPP11_THREAD_
         #ifndef _WEBSOCKETPP_CPP11_THREAD_
             #define _WEBSOCKETPP_CPP11_THREAD_
             #define _WEBSOCKETPP_CPP11_THREAD_
         #endif
         #endif
-    #endif
+//    #endif
+// ATOMIC END
 #endif
 #endif
 
 
 #ifdef _WEBSOCKETPP_CPP11_THREAD_
 #ifdef _WEBSOCKETPP_CPP11_THREAD_

+ 3 - 0
Source/ThirdParty/kNet/CMakeLists.txt

@@ -53,6 +53,9 @@ if (WIN32)
         get_filename_component (baseName ${srcFile} NAME)
         get_filename_component (baseName ${srcFile} NAME)
         set_source_files_properties (${srcFile} PROPERTIES COMPILE_FLAGS "-DDEBUG_CPP_NAME=\"\\\"${baseName}\"\\\"")
         set_source_files_properties (${srcFile} PROPERTIES COMPILE_FLAGS "-DDEBUG_CPP_NAME=\"\\\"${baseName}\"\\\"")
     endforeach ()
     endforeach ()
+   # ATOMIC BEGIN
+   set(LIBS ws2_32.lib)
+   # ATOMIC END
 endif ()
 endif ()
 
 
 # Define source files
 # Define source files

+ 1 - 1
Source/ThirdParty/libcurl/CMakeLists.txt

@@ -1,5 +1,5 @@
 
 
-if (WIN32)
+if (MSVC)
     include(LibCurlWindows.cmake)
     include(LibCurlWindows.cmake)
 else()
 else()
     include(LibCurl.cmake)
     include(LibCurl.cmake)

+ 1 - 1
Source/ThirdParty/libcurl/lib/CMakeLists.txt

@@ -76,7 +76,7 @@ add_library(
   )
   )
 
 
 if(WIN32 AND CURL_STATICLIB)
 if(WIN32 AND CURL_STATICLIB)
-  set_target_properties(${LIB_NAME} PROPERTIES STATIC_LIBRARY_FLAGS ${CMAKE_EXE_LINKER_FLAGS})
+  set_target_properties(${LIB_NAME} PROPERTIES STATIC_LIBRARY_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
 endif()
 endif()
 
 
 target_link_libraries(${LIB_NAME} ${CURL_LIBS})
 target_link_libraries(${LIB_NAME} ${CURL_LIBS})