From 1822b844a5c04ec2a61032df2f1a104c6215d13a Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 28 Apr 2016 15:57:21 -0700 Subject: [PATCH] (maint) Enable builds with static cpp-pcp-client On Windows, Leatherman's logging/locale libraries need to be contained in the same DLL. That can be done by either making them shared libraries, or by creating a monolithic pxp-agent binary. Currently our packaging makes it messy to use shared Leatherman DLLs, and they don't bring us any advantages. Make it simple to use cpp-pcp-client as a static library instead so we can produce a smaller package. --- lib/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index cdb68daf..98de3fee 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -54,6 +54,12 @@ set (LIBS ${LEATHERMAN_LIBRARIES} ) +if (WIN32) + # Necessary when statically linking cpp-pcp-client on Windows. + # Shouldn't hurt when cpp-pcp-client is a DLL. + list(APPEND LIBS Ws2_32) +endif() + if (CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "SunOS" OR CMAKE_SYSTEM_NAME MATCHES "AIX") # On some platforms Boost.Thread has a dependency on clock_gettime. It also depends on pthread, # and FindBoost in CMake 3.2.3 doesn't include that dependency.