Skip to content

Commit 938aa7c

Browse files
committed
fully move client config into client-sdk include directories
1 parent b8d4b1c commit 938aa7c

File tree

15 files changed

+64
-45
lines changed

15 files changed

+64
-45
lines changed

examples/hello-c-client/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <launchdarkly/client_side/bindings/c/sdk.h>
22

3-
#include <launchdarkly/bindings/c/config/builder.h>
43
#include <launchdarkly/bindings/c/context_builder.h>
4+
#include <launchdarkly/client_side/bindings/c/config/builder.h>
55

66
#include <stdbool.h>
77
#include <stdio.h>

libs/common/include/launchdarkly/bindings/c/config/client_side/builder.h renamed to libs/client-sdk/include/launchdarkly/client_side/bindings/c/config/builder.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33

44
#pragma once
55

6-
#include <launchdarkly/bindings/c/config/client_side/config.h>
7-
#include <launchdarkly/bindings/c/config/common/logging_builder.h>
6+
#include <launchdarkly/client_side/bindings/c/config/config.h>
7+
8+
#include <launchdarkly/bindings/c/config/logging_builder.h>
89
#include <launchdarkly/bindings/c/export.h>
910
#include <launchdarkly/bindings/c/status.h>
1011

libs/client-sdk/include/launchdarkly/client_side/bindings/c/sdk.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
// NOLINTBEGIN modernize-use-using
55
#pragma once
66

7-
#include <launchdarkly/bindings/c/config/client_side/config.h>
7+
#include <launchdarkly/client_side/bindings/c/config/config.h>
8+
89
#include <launchdarkly/bindings/c/context.h>
910
#include <launchdarkly/bindings/c/data/evaluation_detail.h>
1011
#include <launchdarkly/bindings/c/export.h>

libs/client-sdk/src/CMakeLists.txt

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
file(GLOB HEADER_LIST CONFIGURE_DEPENDS
33
"${LaunchDarklyCPPClient_SOURCE_DIR}/include/launchdarkly/client_side/*.hpp"
4-
)
4+
)
55

66
# Automatic library: static or dynamic based on user config.
77

@@ -35,6 +35,8 @@ add_library(${LIBNAME}
3535
flag_manager/flag_updater.hpp
3636
event_processor.hpp
3737
bindings/c/sdk.cpp
38+
bindings/c/builder.cpp
39+
bindings/c/config.cpp
3840
data_sources/null_data_source.cpp
3941
flag_manager/context_index.cpp
4042
serialization/json_all_flags.hpp
@@ -43,21 +45,21 @@ add_library(${LIBNAME}
4345
flag_manager/flag_persistence.cpp
4446
bindings/c/sdk.cpp)
4547

46-
if(MSVC OR (NOT BUILD_SHARED_LIBS))
47-
target_link_libraries(${LIBNAME}
48-
PUBLIC launchdarkly::common
49-
PRIVATE Boost::headers Boost::json Boost::url launchdarkly::sse launchdarkly::internal foxy)
50-
else()
51-
# The default static lib builds, for linux, are positition independent.
52-
# So they do not link into a shared object without issues. So, when
53-
# building shared objects do not link the static libraries and instead
54-
# use the "src.hpp" files for required libraries.
55-
# macOS shares the same path for simplicity.
56-
target_link_libraries(${LIBNAME}
57-
PUBLIC launchdarkly::common
58-
PRIVATE Boost::headers launchdarkly::sse launchdarkly::internal foxy)
48+
if (MSVC OR (NOT BUILD_SHARED_LIBS))
49+
target_link_libraries(${LIBNAME}
50+
PUBLIC launchdarkly::common
51+
PRIVATE Boost::headers Boost::json Boost::url launchdarkly::sse launchdarkly::internal foxy)
52+
else ()
53+
# The default static lib builds, for linux, are positition independent.
54+
# So they do not link into a shared object without issues. So, when
55+
# building shared objects do not link the static libraries and instead
56+
# use the "src.hpp" files for required libraries.
57+
# macOS shares the same path for simplicity.
58+
target_link_libraries(${LIBNAME}
59+
PUBLIC launchdarkly::common
60+
PRIVATE Boost::headers launchdarkly::sse launchdarkly::internal foxy)
5961

60-
target_sources(${LIBNAME} PRIVATE boost.cpp)
62+
target_sources(${LIBNAME} PRIVATE boost.cpp)
6163
endif ()
6264

6365
add_library(launchdarkly::client ALIAS ${LIBNAME})
@@ -67,14 +69,14 @@ set_property(TARGET ${LIBNAME} PROPERTY
6769

6870
install(TARGETS ${LIBNAME})
6971
if (BUILD_SHARED_LIBS AND MSVC)
70-
install(FILES $<TARGET_PDB_FILE:${LIBNAME}> DESTINATION bin OPTIONAL)
72+
install(FILES $<TARGET_PDB_FILE:${LIBNAME}> DESTINATION bin OPTIONAL)
7173
endif ()
7274
# Using PUBLIC_HEADERS would flatten the include.
7375
# This will preserve it, but dependencies must do the same.
7476

7577
install(DIRECTORY "${LaunchDarklyCPPClient_SOURCE_DIR}/include/launchdarkly"
7678
DESTINATION "include"
77-
)
79+
)
7880

7981
# Need the public headers to build.
8082
target_include_directories(${LIBNAME} PUBLIC ../include)

libs/common/src/bindings/c/config/client_side/builder.cpp renamed to libs/client-sdk/src/bindings/c/builder.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
// NOLINTBEGIN cppcoreguidelines-pro-type-reinterpret-cast
22
// NOLINTBEGIN OCInconsistentNamingInspection
33

4-
#include <launchdarkly/bindings/c/config/client_side/builder.h>
4+
#include <launchdarkly/client_side/bindings/c/config/builder.h>
5+
56
#include <launchdarkly/config/client.hpp>
67
#include <launchdarkly/detail/c_binding_helpers.hpp>
78
#include <launchdarkly/persistence/persistence.hpp>
89

9-
#include "../common/log_backend_wrapper.hpp"
10-
1110
using namespace launchdarkly::client_side;
1211

1312
#define TO_BUILDER(ptr) (reinterpret_cast<ConfigBuilder*>(ptr))

libs/common/src/bindings/c/config/client_side/config.cpp renamed to libs/client-sdk/src/bindings/c/config.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// NOLINTBEGIN cppcoreguidelines-pro-type-reinterpret-cast
22
// NOLINTBEGIN OCInconsistentNamingInspection
33

4-
#include <launchdarkly/bindings/c/config/client_side/config.h>
4+
#include <launchdarkly/client_side/bindings/c/config/config.h>
55
#include <launchdarkly/config/client.hpp>
66

77
#define TO_CONFIG(ptr) (reinterpret_cast<Config*>(ptr))

libs/client-sdk/tests/client_c_bindings_test.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#include <gtest/gtest.h>
22

3-
#include <launchdarkly/bindings/c/config/client_side/builder.h>
4-
#include <launchdarkly/bindings/c/context_builder.h>
3+
#include <launchdarkly/client_side/bindings/c/config/builder.h>
54
#include <launchdarkly/client_side/bindings/c/sdk.h>
5+
6+
#include <launchdarkly/bindings/c/context_builder.h>
7+
68
#include <launchdarkly/client_side/data_source_status.hpp>
79

810
#include <chrono>

libs/common/tests/bindings/client_config_test.cpp renamed to libs/client-sdk/tests/client_config_test.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <gtest/gtest.h>
2-
#include <launchdarkly/bindings/c/config/client_side/builder.h>
3-
#include "launchdarkly/config/client.hpp"
2+
3+
#include <launchdarkly/client_side/bindings/c/config/builder.h>
4+
#include <launchdarkly/config/client.hpp>
45

56
TEST(ClientConfigBindings, ConfigBuilderNewFree) {
67
LDClientConfigBuilder builder = LDClientConfigBuilder_New("sdk-123");
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
/** @file
2-
* This file exists solely for backwards compatibility purposes
3-
* and will be removed in the next major release.
2+
* This header for the LaunchDarkly C++ Client-side SDK has moved!
43
*
5-
* Please use 'launchdarkly/bindings/c/config/client_side/builder.h' instead.
4+
* Please use 'launchdarkly/client_side/bindings/c/config/builder.h' instead.
65
*
76
* The original C++ Client-side 1.0 release shipped builder.h at this location,
8-
* but it was moved to the client_side subdirectory for distinction with the C++
7+
* but it was moved to the client_side subdirectory to accommodate the C++
98
* Server-side SDK. */
109
#pragma once
1110

12-
#include <launchdarkly/bindings/c/config/client_side/builder.h>
1311
#pragma message( \
14-
"LaunchDarkly Client-side C++ SDK: The config/builder.h header is being removed in the next major version")
12+
"LaunchDarkly Client-side C++ SDK: ACTION REQUIRED: This header has moved!")
1513
#pragma message( \
16-
"LaunchDarkly Client-side C++ SDK: Please use config/client_side/builder.h instead")
14+
"LaunchDarkly Client-side C++ SDK: Please import 'launchdarkly/client_side/bindings/c/config/builder.h' instead")
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/** @file
2+
* This header for the LaunchDarkly C++ Client-side SDK has moved!
3+
*
4+
* Please use 'launchdarkly/client_side/bindings/c/config/config.h' instead.
5+
*
6+
* The original C++ Client-side 1.0 release shipped config.h at this location,
7+
* but it was moved to the client_side subdirectory to accommodate the C++
8+
* Server-side SDK. */
9+
#pragma once
10+
11+
#pragma message( \
12+
"LaunchDarkly Client-side C++ SDK: ACTION REQUIRED: This header has moved!")
13+
#pragma message( \
14+
"LaunchDarkly Client-side C++ SDK: Please import 'launchdarkly/client_side/bindings/c/config/config.h' instead")

libs/common/src/CMakeLists.txt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ file(GLOB HEADER_LIST CONFIGURE_DEPENDS
1111
"${LaunchDarklyCommonSdk_SOURCE_DIR}/include/launchdarkly/config/shared/built/*.hpp"
1212
"${LaunchDarklyCommonSdk_SOURCE_DIR}/include/launchdarkly/data/*.hpp"
1313
"${LaunchDarklyCommonSdk_SOURCE_DIR}/include/launchdarkly/logging/*.hpp"
14-
)
14+
)
1515

1616
# Automatic library: static or dynamic based on user config.
1717
add_library(${LIBNAME} OBJECT
@@ -43,15 +43,14 @@ add_library(${LIBNAME} OBJECT
4343
bindings/c/context_builder.cpp
4444
bindings/c/status.cpp
4545
bindings/c/context.cpp
46-
bindings/c/config/client_side/builder.cpp
47-
bindings/c/config/client_side/config.cpp
48-
bindings/c/config/common/logging_builder.cpp
49-
log_level.cpp
50-
config/persistence_builder.cpp
46+
bindings/c/config/logging_builder.cpp
5147
bindings/c/data/evaluation_detail.cpp
48+
bindings/c/listener_connection.cpp
5249
bindings/c/memory_routines.cpp
50+
log_level.cpp
51+
config/persistence_builder.cpp
5352
config/logging_builder.cpp
54-
bindings/c/listener_connection.cpp)
53+
)
5554

5655
add_library(launchdarkly::common ALIAS ${LIBNAME})
5756

@@ -64,7 +63,7 @@ install(TARGETS ${LIBNAME})
6463
# This will preserve it, but dependencies must do the same.
6564
install(DIRECTORY "${LaunchDarklyCommonSdk_SOURCE_DIR}/include/launchdarkly"
6665
DESTINATION "include"
67-
)
66+
)
6867

6968
message(STATUS "LaunchDarklyCommonSdk_SOURCE_DIR=${LaunchDarklyCommonSdk_SOURCE_DIR}")
7069

libs/common/src/bindings/c/config/common/log_backend_wrapper.hpp renamed to libs/common/src/bindings/c/config/log_backend_wrapper.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#pragma once
22

3+
#include <launchdarkly/bindings/c/config/logging_builder.h>
4+
#include <launchdarkly/logging/log_backend.hpp>
35
/**
46
* Utility class to allow user-provided backends to satisfy the ILogBackend
57
* interface.

libs/common/src/bindings/c/config/common/logging_builder.cpp renamed to libs/common/src/bindings/c/config/logging_builder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <launchdarkly/bindings/c/config/common/logging_builder.h>
1+
#include <launchdarkly/bindings/c/config/logging_builder.h>
22
#include <launchdarkly/config/shared/builders/logging_builder.hpp>
33

44
#include <launchdarkly/detail/c_binding_helpers.hpp>

0 commit comments

Comments
 (0)