This commit is contained in:
Max Howell 2022-11-25 08:02:51 -05:00
parent 05cbd58da5
commit 57ac9ca3a4
2 changed files with 35 additions and 0 deletions

View file

@ -0,0 +1,9 @@
#include <stdio.h>
#include <json-c/json.h>
int main() {
json_object *obj = json_object_new_object();
json_object *value = json_object_new_string("value");
json_object_object_add(obj, "key", value);
printf("%s\n", json_object_to_json_string(obj));
return 0;
}

View file

@ -0,0 +1,26 @@
distributable:
url: https://s3.amazonaws.com/json-c_releases/releases/json-c-{{ version.raw }}.tar.gz
strip-components: 1
versions:
github: json-c/json-c/tags
strip:
- /^json-c-/
- /-\d{8}/ # calver
build:
dependencies:
cmake.org: 3
tea.xyz/gx/cc: c99
tea.xyz/gx/make: '*'
working-directory: build
script: |
cmake .. -DCMAKE_INSTALL_PREFIX="{{prefix}}" -DCMAKE_BUILD_TYPE=Release
make --jobs {{ hw.concurrency }} install
test:
dependencies:
tea.xyz/gx/cc: c99
script: |
cc fixture.c -ljson-c
./a.out