Skip to content

Commit ab7fa7b

Browse files
authored
chore: Add basic build docs. (#114)
1 parent 549260d commit ab7fa7b

File tree

2 files changed

+59
-4
lines changed

2 files changed

+59
-4
lines changed

README.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ This repository contains beta software and should not be considered ready for pr
77

88
## Packages
99

10-
| SDK packages | issues | tests | docs |
11-
|-------------------------------------------------------|---------------------------------------------|----------------------------------------------------------|--------------------------|
10+
| Readme | issues | tests | docs |
11+
|----------------------------------------------|---------------------------------------------|----------------------------------------------------------|--------------------------|
1212
| [libs/client-sdk](libs/client-sdk/README.md) | [C++ Client SDK][package-cpp-client-issues] | [![Actions Status][cpp-client-ci-badge]][cpp-client-ci] |[![Documentation](https://img.shields.io/static/v1?label=GitHub+Pages&message=API+reference&color=00add8)](https://launchdarkly.github.io/cpp-sdks/libs/client-sdk/docs/html/)
1313

1414
| Shared packages | issues | tests |
@@ -18,7 +18,30 @@ This repository contains beta software and should not be considered ready for pr
1818

1919
## Organization
2020

21-
[TODO]
21+
| Directory | Description |
22+
|----------|--------------|
23+
| .github | Contains CI and release process workflows and actions.
24+
| apps | Contains example and test applications.
25+
| cmake | Contains cmake files for importing and configuring external libraries.
26+
| libs | Contains library implementations. This includes libraries shared within the project as well as SDK libraries like the client-sdk.
27+
| scripts | Contains scripts used in the release process.
28+
| vendor | Contains third party source which is directly integrated into the project. Generally third party source is included through CMake using FetchContent, but some libraries require modification specific to this repository.
29+
30+
## Build Requirements
31+
32+
### Dependencies
33+
34+
1. C++17 and above
35+
1. CMake 3.19 or higher
36+
1. Ninja (if using the included build scripts)
37+
1. Boost version 1.80 or higher.
38+
1. OpenSSL
39+
40+
Additional dependencies are fetched via CMake. For details see the `cmake` folder.
41+
42+
GoogleTest is used for testing.
43+
44+
For information on integrating an SDK package please refer to the SDK specific README.
2245

2346
## LaunchDarkly overview
2447

libs/client-sdk/README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,39 @@ This version of the LaunchDarkly SDK is compatible with POSIX environments (Linu
2323
Getting started
2424
---------------
2525

26-
Download a release archive from the [TODO](TODO) for use in your project. Refer to the [SDK documentation](TODO) for complete instructions on installing and using the SDK.
26+
Download a release archive from the [Github releases]https://github.com/launchdarkly/cpp-sdks/releases?q=cpp-client&expanded=true) for use in your project.
27+
28+
Refer to the [SDK documentation](https://docs.launchdarkly.com/sdk/client-side/c-c--) for complete instructions on installing and using the SDK.
29+
30+
### Incorporating the SDK
31+
32+
The SDK can be used via a C++ or C interface and can be incorporated via a static library or shared object. The static library and shared object each have their on use cases and limitations.
33+
34+
The static library supports both the C++ and C interface. When using the static library, you should ensure that it is compiled using a compatible configuration and toolchain. For instance, when using MSVC, it needs to be using the same runtime library.
35+
36+
Using the static library also requires that you have OpenSSL and Boost available at the time of compilation for your project.
37+
38+
The C++ API does not have a stable ABI, so if this is important to you, consider using the shared object with the C API.
39+
40+
Example of basic compilation using the C++ API with a static library using gcc:
41+
```shell
42+
g++ -I path_to_the_sdk_install/include -O3 -std=c++17 -Llib -fPIE -g main.cpp path_to_the_sdk_install/lib/liblaunchdarkly-cpp-client.a -lpthread -lstdc++ -lcrypto -lssl -lboost_json -lboost_url
43+
```
44+
Example of basic compilation using the C API with a static library using msvc:
45+
46+
```shell
47+
cl /I include /Fe: hello.exe main.cpp /link lib/launchdarkly-cpp-client.lib
48+
```
49+
50+
The shared library (so, DLL, dylib), only supports the C interface. The shared object does not require you to have Boost or OpenSSL available when linking the shared object to your project.
51+
52+
Example of basic compilation using the C API with a shared library using gcc:
53+
```shell
54+
gcc -I $(pwd)/include -Llib -fPIE -g main.c liblaunchdarkly-cpp-client.so
55+
```
56+
57+
The examples here are to help with getting started, but generally speaking the SDK should be incorporated using your
58+
build system (CMake for instance).
2759

2860
Learn more
2961
-----------

0 commit comments

Comments
 (0)