Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,26 @@ Invoking `make install` will install the header and library files into
Alternatively, specify `make install prefix=/a/file/path` to install into
/a/file/path/{include,lib}.

You can also use standard `meson` commands to compile and install. To build:

```sh
$ meson setup obj
$ ninja -C obj
```

and to install (by default: the shared library, headers, and `pkg-config`
metadata):

```sh
$ ninja -C obj install
```

to configure for a static build instead:

```sh
$ meson setup --default-library=static obj
```

## Testing

To test against the standard test set provided by toml-lang/toml-test:
Expand All @@ -191,4 +211,4 @@ To test against the standard test set provided by iarna/toml:
% cd test2
% bash build.sh # do this once
% bash run.sh # this will run the test suite
```
```
35 changes: 35 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
project(
'tomlc99', 'c',
meson_version: '>= 0.47.0',
version: 'v1.0',
license: 'MIT',
default_options: [
'warning_level=2',
'c_std=c99',
],
)

toml_sources = ['toml.c']
toml_headers = ['toml.h']

libtoml = library('toml',
sources: toml_sources,
install: true,
version: '1.0',
)

install_headers(toml_headers)

libtoml_dep = declare_dependency(
include_directories: include_directories('.'),
link_with: libtoml,
)

pkg = import('pkgconfig')
pkg.generate(libtoml,
filebase: meson.project_name(),
name: meson.project_name(),
version: meson.project_version(),
description: 'TOML parser in c99; v1.0 compliant',
url: 'https://github.com/cktan/tomlc99',
)