Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(maint) Enable builds with static cpp-pcp-client #406

Merged
merged 1 commit into from
Apr 29, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we just test what kind of cpp-pcp-client library we are linking against? Whether static or shared?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure there's a way to tell from here. /cc @branan

I could add a CMake config file to the cpp-pcp-client project that gets installed, and would replace the Findcpp-pcp-client script in this project. That would include link dependencies and whether it's static or dynamic. However there's pretty much no downside with linking an extra system library.

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.
Expand Down