@@ -38,13 +38,9 @@ if (MSVC)
3838endif ()
3939
4040if (LINK_STATIC)
41- if (MSVC )
42- find_library (PULSAR_LIBRARY NAMES pulsarWithDeps.lib )
43- else ()
44- find_library (PULSAR_LIBRARY NAMES libpulsar.a )
45- endif ()
41+ find_library (PULSAR_LIBRARY NAMES pulsarwithdeps pulsarWithDeps.lib )
4642 add_definitions ("-DPULSAR_STATIC" )
47- else ( )
43+ elseif ( NOT PULSAR_LIBRARY )
4844 find_library (PULSAR_LIBRARY NAMES pulsar libpulsar )
4945endif ()
5046message (STATUS "PULSAR_LIBRARY: ${PULSAR_LIBRARY} " )
@@ -88,43 +84,11 @@ set(PYTHON_WRAPPER_LIBS ${PYTHON_WRAPPER_LIBS} Python3::Module)
8884message (STATUS "All libraries: ${PYTHON_WRAPPER_LIBS} " )
8985
9086if (LINK_STATIC AND NOT MSVC )
91- set (CMAKE_FIND_LIBRARY_SUFFIXES ".a" )
92-
93- # We need to include all the static libs individually because we cannot easily create a universal2 libpulsar.a
94- # with all the deps included.
95- find_package (OpenSSL REQUIRED )
96- message ("OPENSSL_LIBRARIES: " ${OPENSSL_LIBRARIES} )
97-
98- find_package (Protobuf REQUIRED )
99- message ("Protobuf_LIBRARIES: " ${Protobuf_LIBRARIES} )
100-
101- find_package (curl REQUIRED )
102- message ("CURL_LIBRARIES: " ${CURL_LIBRARIES} )
103-
104- find_package (zlib )
105- message ("ZLIB_LIBRARIES: " ${ZLIB_LIBRARIES} )
106-
107- find_library (LIB_ZSTD NAMES libzstd.a )
108- message (STATUS "ZStd: ${LIB_ZSTD} " )
109- find_library (LIB_SNAPPY NAMES libsnappy.a )
110- message (STATUS "LIB_SNAPPY: ${LIB_SNAPPY} " )
111-
112- set (PYTHON_WRAPPER_LIBS ${PYTHON_WRAPPER_LIBS}
113- ${OPENSSL_LIBRARIES}
114- ${Protobuf_LIBRARIES}
115- ${ZLIB_LIBRARIES}
116- ${LIB_ZSTD}
117- ${LIB_SNAPPY}
118- ${CURL_LIBRARIES}
119- )
120-
12187 if (APPLE )
12288 set (CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS} -undefined dynamic_lookup" )
123- target_link_libraries (_pulsar -Wl,-all_load ${PYTHON_WRAPPER_LIBS} )
89+ target_link_libraries (_pulsar ${PYTHON_WRAPPER_LIBS} )
12490 else ()
125- if (NOT MSVC )
126- set (CMAKE_SHARED_LINKER_FLAGS " -static-libgcc -static-libstdc++" )
127- endif ()
91+ set (CMAKE_SHARED_LINKER_FLAGS " -static-libgcc -static-libstdc++" )
12892 target_link_libraries (_pulsar ${PYTHON_WRAPPER_LIBS} )
12993 endif ()
13094elseif (LINK_STATIC) # MSVC
0 commit comments