Struct system_deps::Library

source ·
pub struct Library {
    pub name: String,
    pub source: Source,
    pub libs: Vec<InternalLib>,
    pub link_paths: Vec<PathBuf>,
    pub frameworks: Vec<String>,
    pub framework_paths: Vec<PathBuf>,
    pub include_paths: Vec<PathBuf>,
    pub ld_args: Vec<Vec<String>>,
    pub defines: HashMap<String, Option<String>>,
    pub version: String,
    pub statik: bool,
}
Expand description

A system dependency

Fields§

§name: String

Name of the library

§source: Source

From where the library settings have been retrieved

§libs: Vec<InternalLib>

libraries the linker should link on

§link_paths: Vec<PathBuf>

directories where the compiler should look for libraries

§frameworks: Vec<String>

frameworks the linker should link on

§framework_paths: Vec<PathBuf>

directories where the compiler should look for frameworks

§include_paths: Vec<PathBuf>

directories where the compiler should look for header files

§ld_args: Vec<Vec<String>>

flags that should be passed to the linker

§defines: HashMap<String, Option<String>>

macros that should be defined by the compiler

§version: String

library version

§statik: bool

library is statically linked

Implementations§

source§

impl Library

source

pub fn from_internal_pkg_config<P>( pkg_config_dir: P, lib: &str, version: &str, ) -> Result<Self, BuildInternalClosureError>
where P: AsRef<Path>,

Create a Library by probing pkg-config on an internal directory. This helper is meant to be used by Config::add_build_internal closures after having built the lib to return the library information to system-deps.

This library will be statically linked.

§Arguments
  • pkg_config_dir: the directory where the library .pc file is located
  • lib: the name of the library to look for
  • version: the minimum version of lib required
§Examples
let mut config = system_deps::Config::new();
config.add_build_internal("mylib", |lib, version| {
  // Actually build the library here that fulfills the passed in version requirements
  system_deps::Library::from_internal_pkg_config("build-dir",
      lib, "1.2.4")
});

Trait Implementations§

source§

impl Debug for Library

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.