Files
llgo/c/cjson/README.md

44 lines
1.2 KiB
Markdown
Raw Normal View History

2024-05-14 11:49:37 +08:00
LLGo wrapper of DaveGamble/cJSON
=====
[![Build Status](https://github.com/goplus/cjson/actions/workflows/go.yml/badge.svg)](https://github.com/goplus/cjson/actions/workflows/go.yml)
[![GitHub release](https://img.shields.io/github/v/tag/goplus/cjson.svg?label=release)](https://github.com/goplus/cjson/releases)
[![GoDoc](https://pkg.go.dev/badge/github.com/goplus/cjson.svg)](https://pkg.go.dev/github.com/goplus/cjson)
[![Compiler](https://img.shields.io/badge/compiler-llgo-darkgreen.svg)](https://github.com/goplus/llgo)
[![Language](https://img.shields.io/badge/language-Go+-blue.svg)](https://github.com/goplus/gop)
## How to install
2024-06-14 10:40:46 +08:00
### on macOS (Homebrew)
```sh
brew install cjson
```
2024-06-15 17:35:55 +08:00
### on linux
```sh
apt-get install -y libcjson-dev
```
2024-06-14 10:40:46 +08:00
### from source code
2024-05-14 11:49:37 +08:00
```sh
2024-05-14 13:34:47 +08:00
git clone https://github.com/goplus/cjson.git
cd cjson
git submodule init
git submodule update
2024-05-14 11:49:37 +08:00
mkdir build.dir
cd build.dir
cmake ../cJSON
2024-05-14 13:34:47 +08:00
sudo make install
2024-05-14 11:49:37 +08:00
```
## Demos
The `_demo` directory contains our demos (it start with `_` to prevent the `go` command from compiling it):
* [mkjson](_demo/mkjson/mkjson.go): create a json object and print it
### How to run demos
To run the demos in directory `_demo`:
```sh
cd <demo-directory> # eg. cd _demo/mkjson
llgo run .
```