summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorVladislav Vaintroub <vvaintroub@mysql.com>2009-09-30 03:39:37 +0200
committerVladislav Vaintroub <vvaintroub@mysql.com>2009-09-30 03:39:37 +0200
commit46d04ebdefe05377b86e851d73df22c069d63246 (patch)
treeabeea5fd6b9b99995ec6b277906b6ddbacc5752a /mysys
parente6090f10bb581e8f16f8ecb676a27e184548ef24 (diff)
downloadmariadb-git-46d04ebdefe05377b86e851d73df22c069d63246.tar.gz
Backport of the patch
http://lists.mysql.com/commits/57725 Vladislav Vaintroub 2008-11-03 Cleanup CMakeLists.txt(s) - remove winsock2 (ws2_32) from TARGET_LINK_LIBRARIES. Every exe or dll linked with mysys needs ws2_32, because mysys uses winsock function WSAStartup in my_init(). However, there is no need to explicitely add ws2_32 to the list of TARGET_LINK_LIBRARIES multiple times. Visual Studio comes with a handy pragma that tells linker to add library. So patch replaces bunch of ws2_32 in CMakeLists with single pragma comment(lib,"ws2_32") in my_init.c Additionally, reference to non-existing "debug" library has been removed from TARGET_LINK_LIBRARIES. The correct name of the library is "dbug".
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_init.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mysys/my_init.c b/mysys/my_init.c
index a60927be693..c4fda599481 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -27,6 +27,8 @@
#ifdef _MSC_VER
#include <locale.h>
#include <crtdbg.h>
+/* WSAStartup needs winsock library*/
+#pragma comment(lib, "ws2_32")
#endif
my_bool have_tcpip=0;
static void my_win_init(void);