Skip to content

Commit

Permalink
fix: allow for installing only the client or server SDK independently
Browse files Browse the repository at this point in the history
  • Loading branch information
cwaldren-ld committed Oct 23, 2023
1 parent 994aa49 commit f9e3f7f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ option(LD_DYNAMIC_LINK_OPENSSL

option(LD_BUILD_EXAMPLES "Build hello-world examples." ON)

# If using 'make' as the build system, CMake causes the 'install' target to have a dependency on 'all', meaning
# it will cause a full build. This disables that, allowing us to build piecemeal instead. This is useful
# so that we only need to build the client or server for a given release (if only the client or server were affected.)
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY true)

# All projects in this repo should share the same version of 3rd party depends.
# It's the only way to remain sane.
set(CMAKE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
Expand Down
3 changes: 2 additions & 1 deletion libs/client-sdk/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ add_library(launchdarkly::client ALIAS ${LIBNAME})
set_property(TARGET ${LIBNAME} PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")

install(TARGETS ${LIBNAME})
# Optional in case only the server SDK is being built.
install(TARGETS ${LIBNAME} OPTIONAL)
if (LD_BUILD_SHARED_LIBS AND MSVC)
install(FILES $<TARGET_PDB_FILE:${LIBNAME}> DESTINATION bin OPTIONAL)
endif ()
Expand Down
3 changes: 2 additions & 1 deletion libs/server-sdk/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ add_library(launchdarkly::server ALIAS ${LIBNAME})
set_property(TARGET ${LIBNAME} PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")

install(TARGETS ${LIBNAME})
# Optional in case only the client SDK is being built.
install(TARGETS ${LIBNAME} OPTIONAL)
if (LD_BUILD_SHARED_LIBS AND MSVC)
install(FILES $<TARGET_PDB_FILE:${LIBNAME}> DESTINATION bin OPTIONAL)
endif ()
Expand Down

0 comments on commit f9e3f7f

Please sign in to comment.