From 3443ba5bb36b136e30f9346f93734bb71aa5057b Mon Sep 17 00:00:00 2001 From: Michael Pavlyshko Date: Wed, 9 Jul 2014 01:43:13 +0300 Subject: [PATCH] fix libvcmi linking --- CMakeLists.txt | 7 +++++++ lib/CMakeLists.txt | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1771f27f5..b2890b088 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,6 +54,13 @@ if (APPLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth=256") endif() +if (WIN32) + add_definitions(-DBOOST_THREAD_USE_LIB) + add_definitions(-D_WIN32_WINNT=0x0501) + set(SOCKS_LIB "ws2_32") + set(ICONV_LIB "iconv") +endif() + find_package(Boost 1.48.0 COMPONENTS program_options filesystem system thread locale REQUIRED) find_package(ZLIB REQUIRED) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 8173e1904..93d1ac5d2 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -133,7 +133,7 @@ set(lib_HEADERS add_library(vcmi SHARED ${lib_SRCS} ${lib_HEADERS}) set_target_properties(vcmi PROPERTIES XCODE_ATTRIBUTE_LD_DYLIB_INSTALL_NAME "@rpath/libvcmi.dylib") set_target_properties(vcmi PROPERTIES COMPILE_DEFINITIONS "VCMI_DLL=1") -target_link_libraries(vcmi minizip ${Boost_LIBRARIES} ${SDL_LIBRARY} ${ZLIB_LIBRARIES} ${RT_LIB} ${DL_LIB}) +target_link_libraries(vcmi minizip ${Boost_LIBRARIES} ${SDL_LIBRARY} ${ZLIB_LIBRARIES} ${SOCKS_LIB} ${ICONV_LIB} ${RT_LIB} ${DL_LIB} ) set_target_properties(vcmi PROPERTIES ${PCH_PROPERTIES}) cotire(vcmi)