Skip to content

Commit 403567c

Browse files
committed
convert between msgpack and json
1 parent 4d36456 commit 403567c

File tree

3 files changed

+453
-1
lines changed

3 files changed

+453
-1
lines changed

example/c/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
FIND_PACKAGE (cJSON)
2+
13
LIST (APPEND exec_PROGRAMS
24
lib_buffer_unpack.c
35
simple_c.c
46
speed_test_uint32_array.c
57
speed_test_uint64_array.c
68
user_buffer_unpack.c
79
)
10+
IF (cJSON_FOUND)
11+
LIST (APPEND exec_PROGRAMS jsonconv.c)
12+
ENDIF ()
813

914
FOREACH (source_file ${exec_PROGRAMS})
1015
GET_FILENAME_COMPONENT (source_file_we ${source_file} NAME_WE)
@@ -31,3 +36,8 @@ FOREACH (source_file ${exec_PROGRAMS})
3136
ENDIF ()
3237
ENDIF ()
3338
ENDFOREACH ()
39+
40+
IF (cJSON_FOUND)
41+
TARGET_LINK_LIBRARIES (jsonconv ${CJSON_LIBRARIES})
42+
TARGET_INCLUDE_DIRECTORIES(jsonconv PRIVATE ${CJSON_INCLUDE_DIRS})
43+
ENDIF ()

0 commit comments

Comments
 (0)