jsmn: define macros in build system
This commit is contained in:
parent
1263a38038
commit
68dc6b2158
|
@ -1,2 +1,10 @@
|
||||||
idf_component_register(SRCS "src/jsmn.c"
|
idf_component_register(SRCS "src/jsmn.c"
|
||||||
INCLUDE_DIRS "include")
|
INCLUDE_DIRS "include")
|
||||||
|
|
||||||
|
if(CONFIG_JSMN_PARENT_LINKS)
|
||||||
|
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DJSMN_PARENT_LINKS")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CONFIG_JSMN_STRICT)
|
||||||
|
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DJSMN_STRICT")
|
||||||
|
endif()
|
||||||
|
|
|
@ -4,3 +4,11 @@
|
||||||
|
|
||||||
COMPONENT_ADD_INCLUDEDIRS := include/
|
COMPONENT_ADD_INCLUDEDIRS := include/
|
||||||
COMPONENT_SRCDIRS := src/
|
COMPONENT_SRCDIRS := src/
|
||||||
|
|
||||||
|
ifdef CONFIG_JSMN_PARENT_LINKS
|
||||||
|
src/jsmn.o: CPPFLAGS += -DJSMN_PARENT_LINKS
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef CONFIG_JSMN_STRICT
|
||||||
|
src/jsmn.o: CPPFLAGS += -DJSMN_STRICT
|
||||||
|
endif
|
||||||
|
|
|
@ -37,9 +37,6 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define JSMN_PARENT_LINKS CONFIG_JSMN_PARENT_LINKS
|
|
||||||
#define JSMN_STRICT CONFIG_JSMN_STRICT
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JSON type identifier. Basic types are:
|
* JSON type identifier. Basic types are:
|
||||||
* o Object
|
* o Object
|
||||||
|
|
Loading…
Reference in a new issue