diff --git a/readme.md b/readme.md index 18dad72..426b6ff 100644 --- a/readme.md +++ b/readme.md @@ -2,7 +2,7 @@ [![shield showing current tests status](https://github.com/natecraddock/ziglua/actions/workflows/tests.yml/badge.svg)](https://github.com/natecraddock/ziglua/actions/workflows/tests.yml) [![Discord](https://img.shields.io/discord/1196908820140671077?style=flat&logo=discord)](https://discord.com/invite/XpZqDFvAtK) -A Zig package that provides a complete and lightweight wrapper around the [Lua C API](https://www.lua.org/manual/5.4/manual.html#4). Ziglua currently supports the latest releases of Lua 5.1, 5.2, 5.3, 5.4, and [Luau](https://luau-lang.org) and targets Zig master. Tagged versions of Ziglua are made for stable Zig releases. +Zig bindings for the [Lua C API](https://www.lua.org/manual/5.4/manual.html#4). Ziglua currently supports the latest releases of Lua 5.1, 5.2, 5.3, 5.4, and [Luau](https://luau-lang.org). Ziglua can be used in two ways, either * **embedded** to statically embed the Lua VM in a Zig program, @@ -10,8 +10,10 @@ Ziglua can be used in two ways, either In both cases, Ziglua will compile Lua from source and link against your Zig code making it easy to create software that integrates with Lua without requiring any system Lua libraries. +Ziglua `main` is kept up to date with Zig `master`. See the [`zig-0.13.0`](https://github.com/natecraddock/ziglua/tree/zig-0.13.0) branch for Zig 0.13.0 support. + ## Documentation -Docs are a work in progress and are automatically generated for each push to main. Most functions and public declarations are documented: +Docs are a work in progress and are automatically generated. Most functions and public declarations are documented: * [Ziglua Docs](https://natecraddock.github.io/ziglua/#ziglua.lib.Lua) See [docs.md](https://github.com/natecraddock/ziglua/blob/main/docs.md) for more general information on Ziglua and how it differs from the C API. @@ -34,11 +36,9 @@ Nearly every function in the C API is exposed in Ziglua. Additional convenience ## Integrating Ziglua in your project -Find the archive url of the Ziglua version you want to integrate with your project. For example, the url for the commit **41a110981cf016465f72208c3f1732fd4c92a694** is https://github.com/natecraddock/ziglua/archive/41a110981cf016465f72208c3f1732fd4c92a694.tar.gz. - -Then run `zig fetch --save git+https://github.com/natecraddock/ziglua` to add the most recent commit of ziglua to your `build.zig.zon` file. +Run `zig fetch --save git+https://github.com/natecraddock/ziglua` to add the most recent commit of ziglua to your `build.zig.zon` file. -Add a `#` to the url to use a specific tagged release like `zig fetch --save git+https://github.com/natecraddock/ziglua#0.3.0` +Add a `#` to the url to use a specific tagged release or commit like `zig fetch --save git+https://github.com/natecraddock/ziglua#0.3.0` Then in your `build.zig` file you can use the dependency. @@ -61,10 +61,11 @@ pub fn build(b: *std.Build) void { This will compile the Lua C sources and link with your project. -There are currently two additional options that can be passed to `b.dependency()`: +There are currently three additional options that can be passed to `b.dependency()`: * `.lang`: Set the Lua language to build and embed. Defaults to `.lua54`. Possible values are `.lua51`, `.lua52`, `.lua53`, `.lua54`, and `luau`. * `.shared`: Defaults to `false` for embedding in a Zig program. Set to `true` to dynamically link the Lua source code (useful for creating shared modules). +* `luau_use_4_vector`: defaults to false. Set to true to use 4-vectors instead of the default 3-vector in Luau. For example, here is a `b.dependency()` call that and links against a shared Lua 5.2 library: