fix MinGW
authorMichael Wallner <mike@php.net>
Fri, 18 Dec 2020 12:03:53 +0000 (13:03 +0100)
committerMichael Wallner <mike@php.net>
Fri, 18 Dec 2020 12:03:53 +0000 (13:03 +0100)
include/libmemcachedprotocol-0/callback.h
src/libmemcached/CMakeLists.txt
src/libmemcachedprotocol/CMakeLists.txt
src/libmemcachedutil/CMakeLists.txt
src/libmemcachedutil/pool.cc

index 55382e2982a4043acde3694be8ea5d1605a7a2fe..02f9566ece599040871c6ce932d183d5e35deab8 100644 (file)
@@ -22,7 +22,7 @@ extern "C" {
 # include <stdint.h>
 #endif
 
-#ifdef _MSC_VER
+#if defined _WIN32
 # undef interface
 #endif
 
index 0672fd40aada0a828be9eaa4767927e2559270d6..51d2dd1884392445d7b45334e69a07dab3910ab0 100644 (file)
@@ -145,7 +145,7 @@ set_target_properties(libmemcachedinternal PROPERTIES CXX_STANDARD ${CXX_STANDAR
 target_compile_definitions(libmemcachedinternal PRIVATE -DBUILDING_LIBMEMCACHEDINTERNAL)
 target_link_libraries(libmemcachedinternal PUBLIC libhashkit Threads::Threads ${CMAKE_DL_LIBS})
 target_link_libraries(libmemcachedinternal PRIVATE p9y)
-if(MSVC)
+if(MSVC OR MINGW)
     target_link_libraries(libmemcached PUBLIC wsock32 ws2_32)
 endif()
 if(HAVE_LIBSASL)
index bdb7ba3ed599ec283c57bd2dbac7553d025035d9..74658008c89d27d8f0f99934a477aad0c5f1f5e5 100644 (file)
@@ -23,7 +23,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL AppleClang)
 endif()
 target_link_libraries(libmemcachedprotocol PRIVATE p9y)
 target_link_libraries(libmemcachedprotocol PUBLIC Threads::Threads)
-if(MSVC)
+if(MSVC OR MINGW)
     target_link_libraries(libmemcachedprotocol PUBLIC wsock32 ws2_32)
 endif()
 target_include_directories(libmemcachedprotocol PRIVATE
index 44e0c8a6009d698f87a867e3166bc1ebebcc95c1..e08de1884d47fdc93b34a2a65bb4867a324b9e3b 100644 (file)
@@ -22,10 +22,8 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL AppleClang)
                LINK_FLAGS "-Wl,-undefined,dynamic_lookup"
                )
 endif()
-if(MSVC)
-        set_target_properties(libmemcachedutil PROPERTIES
-                LINK_FLAGS "/FORCE:UNRESOLVED"
-                )
+if(MSVC OR MINGW)
+    target_link_libraries(libmemcachedutil PUBLIC libmemcached)
 endif()
 target_link_libraries(libmemcachedutil PUBLIC Threads::Threads)
 if(HAVE_LIBSASL)
index 7a601d13aa2689585d4dcc6d912813940c811bd5..759b9576c66fe345d1b8fda089092592e077ac9e 100644 (file)
@@ -18,6 +18,7 @@
 #include <cassert>
 #include <cerrno>
 #include <cstring>
+#include <ctime>
 #include <pthread.h>
 #include <memory>