From f9e3f7f9eb65127ce5815426d5cb20296fa2c030 Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Mon, 23 Oct 2023 12:15:39 -0700 Subject: [PATCH] fix: allow for installing only the client or server SDK independently --- CMakeLists.txt | 5 +++++ libs/client-sdk/src/CMakeLists.txt | 3 ++- libs/server-sdk/src/CMakeLists.txt | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b2e811f8..e9f9e29b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") diff --git a/libs/client-sdk/src/CMakeLists.txt b/libs/client-sdk/src/CMakeLists.txt index 7e1b894ce..c24a4b414 100644 --- a/libs/client-sdk/src/CMakeLists.txt +++ b/libs/client-sdk/src/CMakeLists.txt @@ -63,7 +63,8 @@ add_library(launchdarkly::client ALIAS ${LIBNAME}) set_property(TARGET ${LIBNAME} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$: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 $ DESTINATION bin OPTIONAL) endif () diff --git a/libs/server-sdk/src/CMakeLists.txt b/libs/server-sdk/src/CMakeLists.txt index 220dad451..00569be24 100644 --- a/libs/server-sdk/src/CMakeLists.txt +++ b/libs/server-sdk/src/CMakeLists.txt @@ -80,7 +80,8 @@ add_library(launchdarkly::server ALIAS ${LIBNAME}) set_property(TARGET ${LIBNAME} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$: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 $ DESTINATION bin OPTIONAL) endif ()