pub struct Build { /* private fields */ }Expand description
Builder for a compilation of Lua 5.4.
Implementations§
Source§impl Build
impl Build
Sourcepub fn for_current() -> Self
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
impl Build
Sourcepub fn new<P: Platform>(p: P) -> Self
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.
Sourcepub fn try_new<P: Platform>(p: P) -> Result<Self, CcError>
pub fn try_new<P: Platform>(p: P) -> Result<Self, CcError>
Create a new builder based on a Platform.
Sourcepub fn compile(&self, output: &str)
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.
Sourcepub fn try_compile(&self, output: &str) -> Result<(), CcError>
pub fn try_compile(&self, output: &str) -> Result<(), CcError>
Run the compiler, generating the file output.
Sourcepub fn out_dir<P: AsRef<Path>>(&mut self, path: P) -> &mut Self
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.
Sourcepub fn add_lunka_src(&mut self) -> &mut Self
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.
Sourcepub fn try_add_lunka_src(&mut self) -> Result<&mut Self, IoError>
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.
Sourcepub fn add_lua_src<P: AsRef<Path>>(&mut self, root: P) -> &mut Self
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.
Sourcepub fn debug_info(&mut self, emit_debug_info: bool) -> &mut Self
pub fn debug_info(&mut self, emit_debug_info: bool) -> &mut Self
Set whether debug information should be emitted for this build.
Sourcepub fn opt_level(&mut self, opt_level: u32) -> &mut Self
pub fn opt_level(&mut self, opt_level: u32) -> &mut Self
Set the semi-arbitrary optimization level for the generated object files.
Sourcepub fn compat_lua_5_3(&mut self) -> &mut Self
pub fn compat_lua_5_3(&mut self) -> &mut Self
Enable compatibility with Lua 5.3.
Sourcepub fn compat_math_lib(&mut self) -> &mut Self
pub fn compat_math_lib(&mut self) -> &mut Self
Include several deprecated functions in the math library.
Sourcepub fn compat_lt_le(&mut self) -> &mut Self
pub fn compat_lt_le(&mut self) -> &mut Self
Emulate the __le metamethod using __lt.
Sourcepub fn api_checks(&mut self) -> &mut Self
pub fn api_checks(&mut self) -> &mut Self
Enable several consistency checks in the API.
Sourcepub fn lua_lib_path(&mut self, path: &str) -> &mut Self
pub fn lua_lib_path(&mut self, path: &str) -> &mut Self
Set the default path that Lua uses to look for Lua libraries.
Sourcepub fn lua_c_lib_path(&mut self, path: &str) -> &mut Self
pub fn lua_c_lib_path(&mut self, path: &str) -> &mut Self
Set the default path that Lua uses to look for C libraries.
Sourcepub fn dir_separator(&mut self, sep: &str) -> &mut Self
pub fn dir_separator(&mut self, sep: &str) -> &mut Self
Set the directory separator for require submodules.
Sourcepub fn unicode_identifiers(&mut self) -> &mut Self
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.
Sourcepub fn lua_conf<S: AsRef<str>>(&mut self, lua_conf: &LuaConf<S>) -> &mut Self
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.
Sourcepub fn use_32_bits(&mut self) -> &mut Self
pub fn use_32_bits(&mut self) -> &mut Self
Use 32-bit integers and floats despite what the platform is.