msvc support
[awesomized/libmemcached] / src / libmemcachedprotocol / CMakeLists.txt
index 915a3da10335527d47d43f26aa5fe946aa964695..61fbed1560b0e6de26aba1ad222962c629e99ff4 100644 (file)
@@ -1,3 +1,4 @@
+check_include(umem.h)
 
 add_library(libmemcachedprotocol SHARED
         ascii_handler.c
@@ -6,6 +7,7 @@ add_library(libmemcachedprotocol SHARED
         common.h
         handler.c
         pedantic.c
+        ../libmemcached/byteorder.cc
         )
 add_library(memcachedprotocol ALIAS libmemcachedprotocol)
 set_target_properties(libmemcachedprotocol PROPERTIES
@@ -20,6 +22,9 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL AppleClang)
                )
 endif()
 target_link_libraries(libmemcachedprotocol PUBLIC Threads::Threads)
+if(MSVC)
+    target_link_libraries(libmemcachedprotocol PUBLIC wsock32 ws2_32)
+endif()
 target_include_directories(libmemcachedprotocol PRIVATE
         ${CMAKE_SOURCE_DIR}/src
         ${CMAKE_BINARY_DIR}/src