mirror of
https://github.com/json-c/json-c.git
synced 2026-03-29 09:59:06 +08:00
json_pointer: allow the feature to be disabled
Some users may not want to included it in their build/system. So allow a cmake symbol to disable it. A user can do 'cmake -DDISABLE_JSON_POINTER=ON <json_c_root_dir>' and disable the json_pointer functionality. That saves about 17 KB (on an x86_64) machine. This may be useful on smaller embedded systems; even though the saving would be fewer kilobytes. One thing that also needs to change a bit, is that the 'json.h' be autogenerated via cmake, in order to conditionally include that "json_pointer.h" file. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
This commit is contained in:
@@ -24,7 +24,6 @@ set(ALL_TEST_NAMES
|
||||
test_double_serializer
|
||||
test_float
|
||||
test_int_add
|
||||
test_json_pointer
|
||||
test_locale
|
||||
test_null
|
||||
test_parse
|
||||
@@ -37,6 +36,10 @@ set(ALL_TEST_NAMES
|
||||
test_visit
|
||||
test_object_iterator)
|
||||
|
||||
if (NOT DISABLE_JSON_POINTER)
|
||||
set(ALL_TEST_NAMES ${ALL_TEST_NAMES} test_json_pointer)
|
||||
endif()
|
||||
|
||||
foreach(TESTNAME ${ALL_TEST_NAMES})
|
||||
|
||||
add_executable(${TESTNAME} ${TESTNAME}.c)
|
||||
|
||||
Reference in New Issue
Block a user