Skip to content

Commit

Permalink
how about linking boost dynamically?
Browse files Browse the repository at this point in the history
  • Loading branch information
cwaldren-ld committed Nov 28, 2023
1 parent 5bfad73 commit 5da33e2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,18 @@ endif ()
find_package(OpenSSL REQUIRED)
message(STATUS "LaunchDarkly: using OpenSSL v${OPENSSL_VERSION}")

# Even though the main SDK might be a static or shared lib, boost should always statically
# linked into the binary.
set(Boost_USE_STATIC_LIBS ON)

if (LD_BUILD_SHARED_LIBS)
# When building a shared library we hide all symbols
# aside from this we have specifically exported for the C-API.
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
else ()
# If the SDK is being compiled as a static library, link boost in statically so that there's only
# one artifact. Otherwise if the SDK is a dynamic library, then link in boost dynamically because:
# - Boost is compiled without fpic, so we can't link it into our shared lib unless we compile it separately with fpic
# - If the user wants shared libraries, then they probably want to link boost's shared libraries too.
set(Boost_USE_STATIC_LIBS ON)
endif ()

set(Boost_USE_MULTITHREADED ON)
Expand Down
5 changes: 0 additions & 5 deletions libs/client-sdk/src/boost.cpp

This file was deleted.

1 change: 0 additions & 1 deletion libs/server-sdk/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ endif ()
target_sources(${LIBNAME}
PRIVATE
${HEADER_LIST}
boost.cpp
client.cpp
client_impl.cpp
config/config.cpp
Expand Down
5 changes: 0 additions & 5 deletions libs/server-sdk/src/boost.cpp

This file was deleted.

0 comments on commit 5da33e2

Please sign in to comment.