Skip to content

Commit 766afb9

Browse files
authored
Merge pull request msgpack#870 from ygj6/json
convert between msgpack and json via cJSON library
2 parents f3fe1b8 + 403567c commit 766afb9

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,3 +1,5 @@
1+
FIND_PACKAGE (cJSON)
2+
13
LIST (APPEND exec_PROGRAMS
24
boundary.c
35
lib_buffer_unpack.c
@@ -6,6 +8,9 @@ LIST (APPEND exec_PROGRAMS
68
speed_test_uint64_array.c
79
user_buffer_unpack.c
810
)
11+
IF (cJSON_FOUND)
12+
LIST (APPEND exec_PROGRAMS jsonconv.c)
13+
ENDIF ()
914

1015
FOREACH (source_file ${exec_PROGRAMS})
1116
GET_FILENAME_COMPONENT (source_file_we ${source_file} NAME_WE)
@@ -32,3 +37,8 @@ FOREACH (source_file ${exec_PROGRAMS})
3237
ENDIF ()
3338
ENDIF ()
3439
ENDFOREACH ()
40+
41+
IF (cJSON_FOUND)
42+
TARGET_LINK_LIBRARIES (jsonconv ${CJSON_LIBRARIES})
43+
TARGET_INCLUDE_DIRECTORIES(jsonconv PRIVATE ${CJSON_INCLUDE_DIRS})
44+
ENDIF ()

0 commit comments

Comments
 (0)