Skip to main content

lux_lib/lua_rockspec/build/
rust_mlua.rs

1use std::{collections::HashMap, path::PathBuf};
2
3/// Specification for building a rock with the `rust-mlua` build backend
4#[derive(Debug, PartialEq, Default, Clone)]
5pub struct RustMluaBuildSpec {
6    /// Keys are module names in the format normally used by the `require()` function.
7    /// values are the library names in the target directory (without the `lib` prefix).
8    pub modules: HashMap<String, PathBuf>,
9    /// Set if the cargo `target` directory is not in the source root.
10    pub target_path: PathBuf,
11    /// If set to `false` pass `--no-default-features` to cargo.
12    pub default_features: bool,
13    /// Pass additional features
14    pub features: Vec<String>,
15    /// Additional flags to be passed in the cargo invocation.
16    pub cargo_extra_args: Vec<String>,
17    /// Copy additional files to the `lua` directory.
18    /// Keys are the sources, values the destinations (relative to the `lua` directory).
19    pub include: HashMap<PathBuf, PathBuf>,
20}