Skip to content

Commit

Permalink
Cleanup cJSON usage
Browse files Browse the repository at this point in the history
  • Loading branch information
tristan957 committed Jun 23, 2021
1 parent f1df09a commit 1f39d2c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions hsejni/tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ hsejni_parse_test = executable(
],
dependencies: [
hse_mock_dep,
hsejni_dep,
cJSON_dep,
],
)

Expand Down
1 change: 1 addition & 0 deletions lib/_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
#define HSE__CONFIG_H

#mesondefine WITH_COVERAGE
#mesondefine WITH_CJSON_FROM_SUBPROJECT

#endif
1 change: 1 addition & 0 deletions lib/cn/omf.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#define HSE_KVDB_CN_OMF_H

#include <hse_util/omf.h>
#include <hse_util/inttypes.h>

/*****************************************************************
*
Expand Down
7 changes: 6 additions & 1 deletion lib/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ _config_h_data.set(
description: 'Building with coverage support',
)

_config_h_data.set(
'WITH_CJSON_FROM_SUBPROJECT',
cJSON_from_subproject,
description: 'Building with cJSON from subprojects',
)

_config_h = configure_file(
input: '_config.h.in',
output: '_config.h',
Expand Down Expand Up @@ -39,7 +45,6 @@ hse_sources = [
hse_c_args = [
'-D_GNU_SOURCE=1',
'-DCOMPNAME="kvdb"',
'-DCJSON_FROM_SUBPROJECT=@0@'.format(cJSON_from_subproject ? 1 : 0),
]

hse_include_directories = [
Expand Down
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ endif
if get_option('use-system-cjson')
message('For best results, HSE should be built against a static cjson==1.7.14')
cJSON_dep = dependency('libcjson', version: '>=1.7.14', required: true)
cJSON_from_subproject = false
else
cJSON_options = cmake.subproject_options()
cJSON_options.add_cmake_defines({
Expand Down

0 comments on commit 1f39d2c

Please sign in to comment.