Cargo Features

[dependencies]
emo = { version = "0.5.2", default-features = false, features = ["builtin-lua", "system-lua"] }
default = builtin-lua

The builtin-lua feature is set by default whenever emo is added without default-features = false somewhere in the dependency tree.

builtin-lua default = cc

Builds the correct version of Lua 5.3 inside the crate. If you want to link a specialized version of lua into your binary, you can disable this feature to do that, but care must be taken. rlua makes at least the following assumptions about the linked lua library:

  • LUA_INTEGER is long long
  • LUA_NUMBER as double
  • LUA_EXTRASPACE is at least pointer sized and has at least pointer alignment.
  • LUAI_MAXSTACK is 1_000_000
system-lua = pkg-config

Uses pkg-config to find an appropriate lua 5.3 library to link with. All of the caveats about disabling the default builtin-lua feature apply here as well. If neither the builtin-lua nor the system-lua feature is enabled, then no lua library will be linked at all and one must be linked with or built into the final binary manually. The builtin-lua and system-lua features are mutually exclusive and enabling both will cause an error at build time.

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality [may be removed in the future](https://rust-lang.github.io/rfcs/3491-remove-implicit-features.html).

cc build builtin-lua
pkg-config build system-lua?