Build

Struct Build 

Source
pub struct Build { /* private fields */ }
Expand description

Builder for a compilation of Lua 5.4.

Implementations§

Source§

impl Build

Source

pub fn for_current() -> Self

Create a new builder based on the Platform returned by from_current_triple, panicking if determining the platform or setting up failed.

Source§

impl Build

Source

pub fn new<P: Platform>(p: P) -> Self

Create a new builder based on a Platform, panicking if setting up failed.

See also Build::try_new for the non-panicking version.

Source

pub fn try_new<P: Platform>(p: P) -> Result<Self, CcError>

Create a new builder based on a Platform.

Source

pub fn compile(&self, output: &str)

Run the compiler, generating the file output, and panicking if compilation fails.

See also Build::try_compile for the non-panicking version.

Source

pub fn try_compile(&self, output: &str) -> Result<(), CcError>

Run the compiler, generating the file output.

Source

pub fn host(&mut self, host: &str) -> &mut Self

Set the host assumed by this configuration.

Source

pub fn out_dir<P: AsRef<Path>>(&mut self, path: P) -> &mut Self

Set the output directory where all object files and static libraries will be located.

Source

pub fn add_lunka_src(&mut self) -> &mut Self

Add all Lua 5.4.8 source files bundled with this crate, which allows for LuaConf to be used, panicking if an error occurs while reading the directory contents.

Source

pub fn try_add_lunka_src(&mut self) -> Result<&mut Self, IoError>

Add all Lua 5.4.8 source files bundled with this crate, which allows for LuaConf to be used.

Source

pub fn add_lua_src<P: AsRef<Path>>(&mut self, root: P) -> &mut Self

Add all Lua source files found in the specified root, panicking if an error occurs while reading the directory contents.

See also Build::try_add_lua_src for the non-panicking version.

root must be a directory containing both source files (*.c) and headers (*.h).

If LuaConf is used, then the path cannot point to a normal Lua source distribution. See the documentation for LuaConf for more details.

Source

pub fn try_add_lua_src<P: AsRef<Path>>( &mut self, root: P, ) -> Result<&mut Self, IoError>

Add all Lua source files found in the specified root.

root must be a directory containing both source files (*.c) and headers (*.h).

If LuaConf is used, then the path cannot point to a normal Lua source distribution. See the documentation for LuaConf for more details.

Source

pub fn include<P: AsRef<Path>>(&mut self, path: P) -> &mut Self

Add an include directory.

Source

pub fn includes<P>(&mut self, paths: P) -> &mut Self
where P: IntoIterator, P::Item: AsRef<Path>,

Adds multiple include directories.

Source

pub fn debug_info(&mut self, emit_debug_info: bool) -> &mut Self

Set whether debug information should be emitted for this build.

Source

pub fn opt_level(&mut self, opt_level: u32) -> &mut Self

Set the semi-arbitrary optimization level for the generated object files.

Source

pub fn compat_lua_5_3(&mut self) -> &mut Self

Enable compatibility with Lua 5.3.

Source

pub fn compat_math_lib(&mut self) -> &mut Self

Include several deprecated functions in the math library.

Source

pub fn compat_lt_le(&mut self) -> &mut Self

Emulate the __le metamethod using __lt.

Source

pub fn api_checks(&mut self) -> &mut Self

Enable several consistency checks in the API.

Source

pub fn lua_lib_path(&mut self, path: &str) -> &mut Self

Set the default path that Lua uses to look for Lua libraries.

Source

pub fn lua_c_lib_path(&mut self, path: &str) -> &mut Self

Set the default path that Lua uses to look for C libraries.

Source

pub fn dir_separator(&mut self, sep: &str) -> &mut Self

Set the directory separator for require submodules.

Source

pub fn unicode_identifiers(&mut self) -> &mut Self

Enable Unicode Identifiers.

This is a define that isn’t explicitly mentioned in the configuration header, but is checked in lctype.c to build the identifier character table.

Source

pub fn lua_conf<S: AsRef<str>>(&mut self, lua_conf: &LuaConf<S>) -> &mut Self

Use additional configuration provided by a LuaConf in this build.

Source

pub fn use_32_bits(&mut self) -> &mut Self

Use 32-bit integers and floats despite what the platform is.

Auto Trait Implementations§

§

impl Freeze for Build

§

impl RefUnwindSafe for Build

§

impl Send for Build

§

impl Sync for Build

§

impl Unpin for Build

§

impl UnwindSafe for Build

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.