dermesser / libsocket

The ultimate socket library for C and C++, supporting TCP, UDP and Unix sockets (DGRAM and STREAM) on Linux, FreeBSD, Solaris. See also my uvco library for a refreshed version!
https://borgac.net/~lbo/doc/libsocket/
Other
805 stars 196 forks source link

Use CMake SHARED instead of MODULE #29

Closed ice-phoenix closed 8 years ago

ice-phoenix commented 8 years ago

Specifying socket and socket++ to be of type MODULE makes it impossible to link with them via target_link_libraries.

dermesser commented 8 years ago

Which use case do you have for that -- are you including the libsocket CMake files in a project of yours? (my knowledge of CMake, which hasn't been good in the past, is even rustier now...)

The intention was to just produce the SOs, which can be linked against from anywhere. Also, I want to apologize about the month-long delay of my reply :-(

ice-phoenix commented 8 years ago

Taken from the CMake docs:

SHARED libraries are linked dynamically and loaded at runtime. MODULE libraries are plugins that are not linked into other targets but may be loaded dynamically at runtime using dlopen-like functionality.

As I understand it, you're abusing the fact that regular Make allows one to actually link against MODULE library and that it kinda works =)

dermesser commented 8 years ago

32 fixes this.