Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/allyourcodebase/lmdb
Lmdb using the zig build system
https://github.com/allyourcodebase/lmdb
lmdb zig zig-package
Last synced: 3 months ago
JSON representation
Lmdb using the zig build system
- Host: GitHub
- URL: https://github.com/allyourcodebase/lmdb
- Owner: allyourcodebase
- License: bsd-3-clause
- Created: 2024-09-26T11:46:59.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-10-29T10:51:41.000Z (3 months ago)
- Last Synced: 2024-10-29T12:45:51.178Z (3 months ago)
- Topics: lmdb, zig, zig-package
- Language: Zig
- Homepage:
- Size: 39.1 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lmdb
[Lmdb](https://github.com/LMDB/lmdb/tree/mdb.master/libraries/liblmdb) using the [Zig](https://ziglang.org/) build system## Usage
First, update your `build.zig.zon`:
```elvish
# Initialize a `zig build` project if you haven't already
zig init
# Support for `lmdb` starts with 0.9.31 and future releases
zig fetch --save https://github.com/Ultra-Code/lmdb/archive/refs/tags/0.9.31.tar.gz
```Import `lmdb` dependency into build `build.zig` as follows:
```zig
const lmdb_dep = b.dependency("lmdb", .{
.target = target,
.optimize = optimize,
.lto = true,
});
```Using `lmdb` artifacts and module in your project
```zig
const exe = b.addExecutable(.{
.name = exe_name,
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
.strip = strip,
});
exe.want_lto = lto;const liblmdb = lmdb_dep.artifact("lmdb");
const lmdb_module = lmdb_dep.module("lmdb");exe.root_module.addImport("mdb", lmdb_module);
exe.linkLibrary(liblmdb);
```## Supported on Linux, macOS and Windows
- Zig 0.14.0-dev
- Zig 0.13.0