From b14cdf10f1c5df36cdd0dbeb4a8232d97e3e0ed3 Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Sun, 29 Oct 2023 21:53:59 -0400 Subject: [PATCH] Update README for new versioning scheme + env vars --- ctru-sys/README.md | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/ctru-sys/README.md b/ctru-sys/README.md index 280fd83..14febdc 100644 --- a/ctru-sys/README.md +++ b/ctru-sys/README.md @@ -10,23 +10,16 @@ to use this library. ## Version -This crate's version changes according to the version of `libctru` -used to generate the bindings, with the following convention: - - * [`libctru`](https://github.com/devkitPro/libctru) version `X.Y.Z-W` - * `ctru-sys` version `XY.Z.P+X.Y.Z-W` - - where `P` is usually 0 but may be incremented for fixes in e.g. - binding generation, `libc` dependency bump, etc. - -It may be possible to build this crate against a different version of [`libctru`](https://github.com/devkitPro/libctru), -but you may encounter linker errors or ABI issues. A build-time Cargo warning -(displayed when built with `-vv`) will be issued if the build script detects -a mismatch or is unable to check the installed [`libctru`](https://github.com/devkitPro/libctru) version. - -## Generating bindings - -Bindings of new versions of [`libctru`](https://github.com/devkitPro/libctru) can be built using the integrated [`bindgen.sh`](./bindgen.sh) script. +Crate bindings are generated at build time, so the available APIs will depend on the +installed version of `libctru` when the crate is built. If you want to check +what version of `libctru` is being built, you can examine these environment +variables with [`env!`](https://doc.rust-lang.org/std/macro.env.html): + +* `LIBCTRU_VERSION`: full version string (e.g. `"2.3.1-4"`) +* `LIBCTRU_MAJOR`: major version (e.g. `"2"` for version `2.3.1-4`) +* `LIBCTRU_MINOR`: minor version (e.g. `"3"` for version `2.3.1-4`) +* `LIBCTRU_PATCH`: patch version (e.g. `"1"` for version `2.3.1-4`) +* `LIBCTRU_RELEASE`: release version (e.g. `"4"` for version `2.3.1-4`) ## License