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>
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>
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
Returns current CppBuildConfig data.
fn cpp_build_config_mut(&mut self) -> &mut CppBuildConfig
Returns mutable CppBuildConfig data.
fn set_cpp_build_config(&mut self, config: CppBuildConfig)
Sets new CppBuildConfig data.
fn cpp_build_paths(&self) -> &CppBuildPaths
Returns current CppBuildPaths data.
fn cpp_build_paths_mut(&mut self) -> &mut CppBuildPaths
Returns mutable CppBuildPaths data.
fn set_cpp_build_paths(&mut self, config: CppBuildPaths)
Sets new CppBuildPaths data.
fn run_and_return(self) -> Result<()>
Same as run(), but result of the operation is returned to the caller.
fn run(self) -> !
Starts build script with current configuration. The build script performs the following operations:
- Build the C++ wrapper library;
- Generate
ffi.rsfile 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.