forked from intel/tinycbor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
82 lines (56 loc) · 1.33 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
Concise Binary Object Representation (CBOR) Library
===================================================
Build TinyCBOR with Make
------------------------
```bash
make
```
If you want to change the compiler or pass extra compiler flags:
```bash
make CC=clang CFLAGS="-m32 -Oz" LDFLAGS="-m32"
```
Build TinyCBOR with CMake
-------------------------
```bash
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
```
### Compilation options
To configure your build use supported options by add them to the `cmake` invocation.
* Debug build:
```bash
cmake -DCMAKE_BUILD_TYPE=Debug ..
```
* Freestanding build (by default OFF):
```bash
cmake -DTINYCBOR_FREESTANDING_BUILD_ENABLED=ON ..
```
* Build static library (by default ON):
```bash
cmake -DUSE_STATIC_TINYCBOR_LIBRARY=ON ..
```
* Build shared library (by default OFF):
```bash
cmake -DUSE_SHARED_TINYCBOR_LIBRARY=ON ..
```
* Enable building of `json2cbor` and `cbordump`:
```bash
cmake -DENABLE_TOOLS=ON ..
```
The `json2cbor` tool is dependend on [cJSON](https://github.com/DaveGamble/cJSON) being available on your system.
### Testing
To build and run unit tests execute:
```bash
cmake -DENABLE_TESTING=ON ..
cmake --build .
ctest .
```
### Installation
```bash
cmake --install .
```
Documentation
-------------
<https://intel.github.io/tinycbor/current/>