@@ -43,11 +43,6 @@ elseif (WITH_LIBSODIUM)
43
43
if (SODIUM_FOUND)
44
44
message (STATUS "Using libsodium for CURVE security" )
45
45
include_directories (${SODIUM_INCLUDE_DIRS} )
46
-
47
- # On Solaris, libsodium depends on libssp
48
- if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS" )
49
- target_link_libraries (libzmq ssp)
50
- endif ()
51
46
set (ZMQ_USE_LIBSODIUM 1)
52
47
set (ZMQ_HAVE_CURVE 1)
53
48
set (pkg_config_libs_private "${pkg_config_libs_private} -lsodium" )
@@ -764,7 +759,6 @@ if (MSVC)
764
759
set ( CMAKE_STATIC_LINKER_FLAGS /ignore :4221 )
765
760
if (BUILD_SHARED)
766
761
add_library (libzmq SHARED ${sources} ${public_headers} ${html-docs} ${readme-docs} ${CMAKE_CURRENT_BINARY_DIR} /NSIS.template.in ${CMAKE_CURRENT_BINARY_DIR} /version .rc)
767
- target_link_libraries (libzmq ${OPTIONAL_LIBRARIES} )
768
762
set_target_properties (libzmq PROPERTIES
769
763
PUBLIC_HEADER "${public_headers} "
770
764
RELEASE_POSTFIX "${MSVC_TOOLSET} -mt-${ZMQ_VERSION_MAJOR} _${ZMQ_VERSION_MINOR} _${ZMQ_VERSION_PATCH} "
@@ -798,7 +792,6 @@ else ()
798
792
799
793
if (BUILD_SHARED)
800
794
add_library (libzmq SHARED $<TARGET_OBJECTS:objects> ${public_headers} ${html-docs} ${readme-docs} ${zmq-pkgconfig} ${CMAKE_CURRENT_BINARY_DIR} /version .rc)
801
- target_link_libraries (libzmq ${OPTIONAL_LIBRARIES} )
802
795
# NOTE: the SOVERSION and VERSION MUST be the same as the one generated by libtool! It is NOT the same as the version of the package.
803
796
set_target_properties (libzmq PROPERTIES
804
797
COMPILE_DEFINITIONS "DLL_EXPORT"
@@ -849,11 +842,16 @@ foreach (target ${target_outputs})
849
842
endforeach ()
850
843
851
844
if (BUILD_SHARED)
852
- target_link_libraries (libzmq ${CMAKE_THREAD_LIBS_INIT} )
853
-
845
+ target_link_libraries (libzmq ${OPTIONAL_LIBRARIES} ${ CMAKE_THREAD_LIBS_INIT} )
846
+
854
847
if (SODIUM_FOUND)
855
848
target_link_libraries (libzmq ${SODIUM_LIBRARIES} )
849
+ # On Solaris, libsodium depends on libssp
850
+ if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS" )
851
+ target_link_libraries (libzmq ssp)
852
+ endif ()
856
853
endif ()
854
+
857
855
if (HAVE_WS2_32)
858
856
target_link_libraries (libzmq ws2_32)
859
857
elseif (HAVE_WS2)
@@ -873,6 +871,36 @@ if (BUILD_SHARED)
873
871
endif ()
874
872
endif ()
875
873
874
+ if (BUILD_STATIC)
875
+ target_link_libraries (libzmq-static ${OPTIONAL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} )
876
+
877
+ if (SODIUM_FOUND)
878
+ target_link_libraries (libzmq-static ${SODIUM_LIBRARIES} )
879
+ # On Solaris, libsodium depends on libssp
880
+ if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS" )
881
+ target_link_libraries (libzmq-static ssp)
882
+ endif ()
883
+ endif ()
884
+
885
+ if (HAVE_WS2_32)
886
+ target_link_libraries (libzmq-static ws2_32)
887
+ elseif (HAVE_WS2)
888
+ target_link_libraries (libzmq-static ws2)
889
+ endif ()
890
+
891
+ if (HAVE_RPCRT4)
892
+ target_link_libraries (libzmq-static rpcrt4)
893
+ endif ()
894
+
895
+ if (HAVE_IPHLAPI)
896
+ target_link_libraries (libzmq-static iphlpapi)
897
+ endif ()
898
+
899
+ if (RT_LIBRARY)
900
+ target_link_libraries (libzmq-static -lrt)
901
+ endif ()
902
+ endif ()
903
+
876
904
if (BUILD_SHARED)
877
905
set (perf-tools local_lat
878
906
remote_lat
@@ -890,11 +918,7 @@ if (BUILD_SHARED)
890
918
if (WITH_PERF_TOOL)
891
919
foreach (perf-tool ${perf-tools})
892
920
add_executable (${perf-tool} perf/${perf-tool}.cpp)
893
- target_link_libraries (${perf-tool} libzmq ${OPTIONAL_LIBRARIES} )
894
-
895
- if (RT_LIBRARY)
896
- target_link_libraries (${perf-tool} -lrt)
897
- endif ()
921
+ target_link_libraries (${perf-tool} libzmq)
898
922
899
923
if (ZMQ_BUILD_FRAMEWORK)
900
924
# Copy perf-tools binaries into Framework
0 commit comments