From 909f12a23a65243077013634ec95eea5a92d3880 Mon Sep 17 00:00:00 2001 From: Frank Voorburg Date: Mon, 11 Dec 2017 16:30:02 +0000 Subject: [PATCH] Refs #318. Corrected CMakeLists to not link the Winsock library under Unix. git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@389 5dc33758-31d5-4daf-9ae8-b24bf3d40d73 --- Host/Source/LibOpenBLT/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Host/Source/LibOpenBLT/CMakeLists.txt b/Host/Source/LibOpenBLT/CMakeLists.txt index a56a37a7..e448ccd6 100644 --- a/Host/Source/LibOpenBLT/CMakeLists.txt +++ b/Host/Source/LibOpenBLT/CMakeLists.txt @@ -168,6 +168,9 @@ if(BUILD_SHARED) # path. This way an (optional) seed and key shared library file can simply be in the # same directory as the LibOpenBLT shared library. target_link_libraries(openblt_shared usb-1.0 dl "-Wl,-rpath,.") + elseif(WIN32) + # Link the Winsock library + target_link_libraries(openblt_shared ws2_32) endif(UNIX) if(CMAKE_C_COMPILER_ID MATCHES MSVC) # Microsoft Visual Studio does not add "lib" to the name of the DLL, whereas GCC @@ -176,8 +179,6 @@ if(BUILD_SHARED) else() SET_TARGET_PROPERTIES(openblt_shared PROPERTIES OUTPUT_NAME openblt CLEAN_DIRECT_OUTPUT 1) endif() - # Link the Winsock library - target_link_libraries(openblt_shared ws2_32) endif(BUILD_SHARED) # Only generate the PC-lint taget if the option is enabled. Use "make openblt_LINT" to