Struct rb_sys_build::RbConfig
source · pub struct RbConfig {
pub search_paths: Vec<SearchPath>,
pub libs: Vec<Library>,
pub link_args: Vec<String>,
pub cflags: Vec<String>,
pub blocklist_lib: Vec<String>,
pub blocklist_link_arg: Vec<String>,
/* private fields */
}
Expand description
Extracts structured information from raw compiler/linker flags to make compiling Ruby gems easier.
Fields§
§search_paths: Vec<SearchPath>
§libs: Vec<Library>
§link_args: Vec<String>
§cflags: Vec<String>
§blocklist_lib: Vec<String>
§blocklist_link_arg: Vec<String>
Implementations§
source§impl RbConfig
impl RbConfig
sourcepub fn link_ruby(&mut self, is_static: bool) -> &mut Self
pub fn link_ruby(&mut self, is_static: bool) -> &mut Self
Pushes the LIBRUBYARG
flags so Ruby will be linked.
sourcepub fn libruby_static_name(&self) -> String
pub fn libruby_static_name(&self) -> String
Get the name for libruby-static (i.e. ruby.3.1-static
).
sourcepub fn libruby_so_name(&self) -> String
pub fn libruby_so_name(&self) -> String
Get the name for libruby (i.e. ruby.3.1
)
sourcepub fn blocklist_lib(&mut self, name: &str) -> &mut RbConfig
pub fn blocklist_lib(&mut self, name: &str) -> &mut RbConfig
Filter the libs, removing the ones that are not needed.
sourcepub fn blocklist_link_arg(&mut self, name: &str) -> &mut RbConfig
pub fn blocklist_link_arg(&mut self, name: &str) -> &mut RbConfig
Blocklist a link argument.
sourcepub fn ruby_program_version(&self) -> String
pub fn ruby_program_version(&self) -> String
Returns the current ruby program version.
sourcepub fn cppflags(&self) -> Vec<String>
pub fn cppflags(&self) -> Vec<String>
Get the CPPFLAGS from the RbConfig, making sure to subsitute variables.
sourcepub fn get(&self, key: &str) -> String
pub fn get(&self, key: &str) -> String
Returns the value of the given key from the either the matching
RBCONFIG_{key}
environment variable or RbConfig::CONFIG[{key}]
hash.
sourcepub fn is_cross_compiling(&self) -> bool
pub fn is_cross_compiling(&self) -> bool
Returns true if the current Ruby is cross compiling.
sourcepub fn get_optional(&self, key: &str) -> Option<String>
pub fn get_optional(&self, key: &str) -> Option<String>
Returns the value of the given key from the either the matching
RBCONFIG_{key}
environment variable or RbConfig::CONFIG[{key}]
hash.
sourcepub fn push_cflags(&mut self, cflags: &str) -> &mut Self
pub fn push_cflags(&mut self, cflags: &str) -> &mut Self
Push cflags string
sourcepub fn major_minor(&self) -> (u32, u32)
pub fn major_minor(&self) -> (u32, u32)
Get major/minor version tuple of Ruby
sourcepub fn cargo_args(&self) -> Vec<String>
pub fn cargo_args(&self) -> Vec<String>
Get the rb_config output for cargo
sourcepub fn print_cargo_args(&self)
pub fn print_cargo_args(&self)
Print to rb_config output for cargo
sourcepub fn push_dldflags(&mut self, input: &str) -> &mut Self
pub fn push_dldflags(&mut self, input: &str) -> &mut Self
Adds items to the rb_config based on a string from LDFLAGS/DLDFLAGS
sourcepub fn set_value_for_key(&mut self, key: &str, value: String)
pub fn set_value_for_key(&mut self, key: &str, value: String)
Sets a value for a key
pub fn has_ruby_dln_check_abi(&self) -> bool
pub fn have_ruby_header<T: AsRef<str>>(&self, header: T) -> bool
Trait Implementations§
source§impl PartialEq for RbConfig
impl PartialEq for RbConfig
impl Eq for RbConfig
impl StructuralPartialEq for RbConfig
Auto Trait Implementations§
impl Freeze for RbConfig
impl RefUnwindSafe for RbConfig
impl Send for RbConfig
impl Sync for RbConfig
impl Unpin for RbConfig
impl UnwindSafe for RbConfig
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more