diff --git a/src/json-c-test.c b/src/json-c-test.c new file mode 100644 index 00000000..676d6be4 --- /dev/null +++ b/src/json-c-test.c @@ -0,0 +1,23 @@ +/* + * This file is part of MXE. + * See index.html for further information. + */ + +#include +#include + +int main(int argc, char *argv[]) +{ + json_object *jobj; + + (void)argc; + (void)argv; + + jobj = json_object_new_object(); + if (!jobj) { + return 1; + } + json_object_object_add(jobj, "key", json_object_new_string("value")); + printf("%s", json_object_to_json_string(jobj)); + return 0; +} diff --git a/src/json-c.mk b/src/json-c.mk index 9533971b..e7222138 100644 --- a/src/json-c.mk +++ b/src/json-c.mk @@ -25,4 +25,9 @@ define $(PKG)_BUILD --disable-shared CFLAGS=-Wno-error $(MAKE) -C '$(1)' -j '$(JOBS)' install + + '$(TARGET)-gcc' \ + -W -Wall -Werror -ansi -pedantic \ + '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-json-c.exe' \ + `'$(TARGET)-pkg-config' json --cflags --libs` endef