Struct cpp_to_rust_build_tools::Config
[−]
[src]
pub struct Config { /* fields omitted */ }
Configuration of the build script.
Methods
impl Config
[src]
fn new() -> Result<Config>
[src]
Constructs default configuration state based on
information in the generated build_script_data.json
file
located at the crate root. The caller may change
CppBuildPaths
and CppBuildConfig
values stored in this object
and call config.run()
to apply them.
fn original_cpp_lib_version(&self) -> Option<&str>
[src]
Returns version of the native C++ library used for generating this crate.
This is the value set with Config::set_cpp_lib_version
during generation,
or None
if the version was not set.
fn cpp_build_config(&self) -> &CppBuildConfig
[src]
Returns current CppBuildConfig
data.
fn cpp_build_config_mut(&mut self) -> &mut CppBuildConfig
[src]
Returns mutable CppBuildConfig
data.
fn set_cpp_build_config(&mut self, config: CppBuildConfig)
[src]
Sets new CppBuildConfig
data.
fn cpp_build_paths(&self) -> &CppBuildPaths
[src]
Returns current CppBuildPaths
data.
fn cpp_build_paths_mut(&mut self) -> &mut CppBuildPaths
[src]
Returns mutable CppBuildPaths
data.
fn set_cpp_build_paths(&mut self, config: CppBuildPaths)
[src]
Sets new CppBuildPaths
data.
fn run_and_return(self) -> Result<()>
[src]
Same as run()
, but result of the operation is returned to the caller.
fn run(self) -> !
[src]
Starts build script with current configuration. The build script performs the following operations:
- Build the C++ wrapper library;
- Generate
ffi.rs
file with actual link attributes; - Determine C++ type sizes on current platform and generate
type_sizes.rs
; - Report linking information to
cargo
.
This function ends the process with the appropriate error code and never returns to the caller.