pub struct Build { /* private fields */ }Expand description
Configuration for compiling the bundled Samba source.
Defaults are read from Cargo’s OUT_DIR, TARGET, and HOST environment variables.
Implementations§
Source§impl Build
impl Build
Sourcepub fn out_dir<P: AsRef<Path>>(&mut self, path: P) -> &mut Build
pub fn out_dir<P: AsRef<Path>>(&mut self, path: P) -> &mut Build
Sets the directory used for cloned sources and build outputs.
Sourcepub fn target(&mut self, target: &str) -> &mut Build
pub fn target(&mut self, target: &str) -> &mut Build
Sets the target triple passed to the native toolchain.
Sourcepub fn host(&mut self, host: &str) -> &mut Build
pub fn host(&mut self, host: &str) -> &mut Build
Sets the host triple used to select the native make command.
Sourcepub fn samba_dir<P: AsRef<Path>>(&mut self, path: P) -> &mut Build
pub fn samba_dir<P: AsRef<Path>>(&mut self, path: P) -> &mut Build
Stores the intended Samba installation prefix.
The current static-library build does not pass this value to Samba’s configure script.
Sourcepub fn gnutls(&mut self, paths: Vec<PathBuf>) -> &mut Build
pub fn gnutls(&mut self, paths: Vec<PathBuf>) -> &mut Build
Sets additional GnuTLS include directories used on macOS.
Sourcepub fn build(&mut self) -> Artifacts
pub fn build(&mut self) -> Artifacts
Builds Samba and returns the generated artifacts.
Build failures are emitted as Cargo warnings and written to standard error.
§Process termination
Exits the process with status code 1 if the native build fails.
Sourcepub fn try_build(&mut self) -> Result<Artifacts, String>
pub fn try_build(&mut self) -> Result<Artifacts, String>
Attempts to build Samba and returns the generated artifacts.
This clones the matching Samba tag, runs its configuration and make steps, and assembles a
static libsmbclient archive.
§Errors
Returns an error when required configuration is absent, the target is unsupported, source retrieval fails, filesystem operations fail, or a native build command fails.