Struct vcpkg::Config[][src]

pub struct Config { /* fields omitted */ }

Configuration options for finding packages, setting up the tree and emitting metadata to cargo

Implementations

impl Config[src]

pub fn new() -> Config[src]

pub fn find_package(&mut self, port_name: &str) -> Result<Library, Error>[src]

Find the package port_name in a Vcpkg tree.

Emits cargo metadata to link to libraries provided by the Vcpkg package/port named, and any (non-system) libraries that they depend on.

This will select the architecture and linkage based on environment variables and build flags as described in the module docs, and any configuration set on the builder.

pub fn cargo_metadata(&mut self, cargo_metadata: bool) -> &mut Config[src]

Define whether metadata should be emitted for cargo allowing it to automatically link the binary. Defaults to true.

pub fn emit_includes(&mut self, emit_includes: bool) -> &mut Config[src]

Define cargo:include= metadata should be emitted. Defaults to false.

pub fn copy_dlls(&mut self, copy_dlls: bool) -> &mut Config[src]

Should DLLs be copied to OUT_DIR? Defaults to true.

pub fn vcpkg_root(&mut self, vcpkg_root: PathBuf) -> &mut Config[src]

Define which path to use as vcpkg root overriding the VCPKG_ROOT environment variable Default to None, which means use VCPKG_ROOT or try to find out automatically

pub fn target_triplet<S: AsRef<str>>(&mut self, triplet: S) -> &mut Config[src]

Specify target triplet. When triplet is not specified, inferred triplet from rust target is used.

Specifying a triplet using target_triplet will override the default triplet for this crate. This cannot change the choice of triplet made by other crates, so a safer choice will be to set VCPKGRS_TRIPLET in the environment which will allow all crates to use a consistent set of external dependencies.

pub fn lib_name(&mut self, lib_stem: &str) -> &mut Config[src]

Override the name of the library to look for if it differs from the package name.

It should not be necessary to use lib_name anymore. Calling find_package with a package name will result in the correct library names. This may be called more than once if multiple libs are required. All libs must be found for the probe to succeed. .probe() must be run with a different configuration to look for libraries under one of several names. .libname("ssleay32") will look for ssleay32.lib and also ssleay32.dll if dynamic linking is selected.

pub fn lib_names(&mut self, lib_stem: &str, dll_stem: &str) -> &mut Config[src]

Override the name of the library to look for if it differs from the package name.

It should not be necessary to use lib_names anymore. Calling find_package with a package name will result in the correct library names. This may be called more than once if multiple libs are required. All libs must be found for the probe to succeed. .probe() must be run with a different configuration to look for libraries under one of several names. .lib_names("libcurl_imp","curl") will look for libcurl_imp.lib and also curl.dll if dynamic linking is selected.

Trait Implementations

impl Default for Config[src]

Auto Trait Implementations

impl RefUnwindSafe for Config

impl Send for Config

impl Sync for Config

impl Unpin for Config

impl UnwindSafe for Config

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.