Skip to content
This repository was archived by the owner on Dec 6, 2024. It is now read-only.

Commit 2f253fd

Browse files
prepare 2.1.3 release (#23)
1 parent 11e563f commit 2f253fd

File tree

32 files changed

+176
-21
lines changed

32 files changed

+176
-21
lines changed

CMakeLists.txt

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ if(NOT DEFINED MSVC)
2525
endif()
2626

2727
set(LD_INCLUDE_PATHS
28-
"src" "third-party/include" ${CURL_INCLUDE_DIR} ${PCRE_INCLUDE_DIR}
28+
"src"
29+
"third-party/include"
30+
"c-sdk-common/include"
31+
"c-sdk-common/src"
32+
${CURL_INCLUDE_DIR}
33+
${PCRE_INCLUDE_DIR}
2934
)
3035

3136
if(APPLE)
@@ -36,7 +41,7 @@ if (REDIS_STORE)
3641
add_subdirectory(stores/redis)
3742
endif (REDIS_STORE)
3843

39-
file(GLOB SOURCES "src/*" "third-party/src/*")
44+
file(GLOB SOURCES "src/*" "third-party/src/*" "c-sdk-common/src/*")
4045

4146
if(NOT DEFINED MSVC)
4247
list(REMOVE_ITEM SOURCES
@@ -101,12 +106,18 @@ if(NOT SKIP_BASE_INSTALL)
101106
DESTINATION include
102107
FILES_MATCHING PATTERN "*.h*"
103108
)
109+
110+
INSTALL(
111+
DIRECTORY ${PROJECT_SOURCE_DIR}/c-sdk-common/include/
112+
DESTINATION include
113+
FILES_MATCHING PATTERN "*.h*"
114+
)
104115
endif()
105116

106117
# test targets ----------------------------------------------------------------
107118

108119
if(BUILD_TESTING)
109-
file(GLOB TEST_UTILS_SRC "test-utils/src/*")
120+
file(GLOB TEST_UTILS_SRC "test-utils/src/*" "c-sdk-common/test-utils/src/*")
110121

111122
add_library(test-utils STATIC ${TEST_UTILS_SRC})
112123

@@ -115,6 +126,7 @@ if(BUILD_TESTING)
115126
target_include_directories(test-utils
116127
PUBLIC ${LD_INCLUDE_PATHS}
117128
"test-utils/include"
129+
"c-sdk-common/test-utils/include"
118130
)
119131

120132
target_compile_definitions(test-utils

Doxyfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ MACRO_EXPANSION = YES
88
PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS
99
USE_MDFILE_AS_MAINPAGE = docs/mainpage.md
1010
RECURSIVE = YES
11-
INCLUDE_PATH = include
12-
INPUT = include docs/mainpage.md
11+
INCLUDE_PATH = include c-sdk-common/include
12+
INPUT = include c-sdk-common/include docs/mainpage.md
1313
GENERATE_HTML = YES
1414
GENERATE_LATEX = NO
1515
GENERATE_TREEVIEW = YES

c-sdk-common/.circleci/config.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: 2.1
2+
3+
workflows:
4+
version: 2
5+
build_and_test_all:
6+
jobs:
7+
- build-test-linux
8+
jobs:
9+
build-test-linux:
10+
docker:
11+
- image: ldcircleci/ld-c-sdk-ubuntu # defined in sdks-ci-docker project
12+
steps:
13+
- checkout
14+
- run:
15+
name: Build
16+
command: |
17+
mkdir -p build
18+
cd build
19+
cmake ..
20+
make

c-sdk-common/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build/

c-sdk-common/CMakeLists.txt

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
cmake_minimum_required(VERSION 2.8.8)
2+
3+
project(ldsharedapi)
4+
5+
find_package(CURL REQUIRED)
6+
7+
if(NOT DEFINED MSVC)
8+
set(LD_LIBRARIES pthread m)
9+
endif()
10+
11+
set(LD_INCLUDE_PATHS
12+
"src"
13+
"include"
14+
${CURL_INCLUDE_DIR}
15+
"test-utils/include"
16+
"test-utils/src"
17+
)
18+
19+
if(APPLE)
20+
set(LD_INCLUDE_PATHS ${LD_INCLUDE_PATHS} "/usr/local/include")
21+
set(LD_PUBLIC_LIBRARIES "-framework CoreFoundation" "-framework IOKit")
22+
endif(APPLE)
23+
24+
file(GLOB SOURCES "src/*" "test-utils/src/*")
25+
26+
set(LD_LIBRARIES ${LD_LIBRARIES} ${CURL_LIBRARIES})
27+
28+
# ldsharedapi target -----------------------------------------------------------
29+
30+
add_library(ldsharedapi ${SOURCES})
31+
32+
target_link_libraries(ldsharedapi
33+
PUBLIC ${LD_PUBLIC_LIBRARIES}
34+
PRIVATE ${LD_LIBRARIES}
35+
)
36+
37+
target_include_directories(ldsharedapi
38+
PUBLIC "include"
39+
PRIVATE ${LD_INCLUDE_PATHS}
40+
)
41+
42+
if(MSVC)
43+
target_compile_definitions(ldsharedapi
44+
PRIVATE -D CURL_STATICLIB
45+
-D _CRT_SECURE_NO_WARNINGS
46+
-D LAUNCHDARKLY_USE_ASSERT
47+
)
48+
else()
49+
target_compile_definitions(ldsharedapi
50+
PRIVATE -D __USE_XOPEN
51+
-D _GNU_SOURCE
52+
-D LAUNCHDARKLY_USE_ASSERT
53+
)
54+
55+
target_compile_options(ldsharedapi
56+
PRIVATE -fno-omit-frame-pointer
57+
-pedantic
58+
-Wall
59+
-Wextra
60+
)
61+
endif(MSVC)

c-sdk-common/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# C SDK Common
2+
3+
Shared components for `c-server-sdk`, and `c-client-sdk`. This repository is *private* because it is intended to be used as a git subtree.
4+
5+
## Updating
6+
7+
A git subtree is not automatically updated. From either the `c-client-sdk` or `c-server-sdk` repository run: `git subtree pull --prefix c-sdk-common git@github.com:launchdarkly/c-sdk-common.git master --squash`.

c-sdk-common/attribution/cjson.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.
File renamed without changes.

include/launchdarkly/export.h renamed to c-sdk-common/include/launchdarkly/export.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#define LD_EXPORT(x) x
1111
#else
1212
#ifdef _WIN32
13-
#define LD_EXPORT(x) __declspec(dllexport) x __stdcall
13+
#define LD_EXPORT(x) __declspec(dllexport) x
1414
#else
1515
#define LD_EXPORT(x) __attribute__((visibility("default"))) x
1616
#endif

include/launchdarkly/json.h renamed to c-sdk-common/include/launchdarkly/json.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ LD_EXPORT(struct LDJSON *) LDNewBool(const LDBoolean boolean);
5555
LD_EXPORT(struct LDJSON *) LDNewNumber(const double number);
5656

5757
/**
58-
* @brief Returns a a new constructed JSON node of type `LDJSONText`.
58+
* @brief Returns a new constructed JSON node of type `LDJSONText`.
5959
* @param[in] text The text to copy and then assign the new node.
6060
* May not be `NULL`.
6161
* @return `NULL` on failure.
@@ -223,7 +223,7 @@ LD_EXPORT(struct LDJSON *) LDCollectionDetachIter(
223223
* @param[in] array May not be `NULL`.
224224
* must be of type `LDJSONArray`.
225225
* @param[in] index The index to lookup in the array
226-
* @return Item if it exists, otherwise `NULL if does not exist, or on failure.`
226+
* @return Item if it exists, otherwise `NULL` if does not exist, or on failure.
227227
*/
228228
LD_EXPORT(struct LDJSON *) LDArrayLookup(const struct LDJSON *const array,
229229
const unsigned int index);
@@ -314,7 +314,7 @@ LD_EXPORT(LDBoolean) LDObjectMerge(struct LDJSON *const to,
314314
******************************************************************************/
315315

316316
/**
317-
* @brief Serialize JSON text into a JSON structure.
317+
* @brief Serialize JSON structure into JSON text.
318318
* @param[in] json Structure to serialize.
319319
* May be `NULL`.
320320
* @return `NULL` on failure

0 commit comments

Comments
 (0)