|
|
@ -240,8 +240,8 @@ impl Config { |
|
|
|
/// .define("BAZ", None)
|
|
|
|
/// .compile("foo");
|
|
|
|
/// ```
|
|
|
|
pub fn define(&mut self, var: &str, val: Option<&str>) -> &mut Config { |
|
|
|
self.definitions.push((var.to_string(), val.map(|s| s.to_string()))); |
|
|
|
pub fn define<'a, V: Into<Option<&'a str>>>(&mut self, var: &str, val: V) -> &mut Config { |
|
|
|
self.definitions.push((var.to_string(), val.into().map(|s| s.to_string()))); |
|
|
|
self |
|
|
|
} |
|
|
|
|
|
|
@ -385,8 +385,8 @@ impl Config { |
|
|
|
/// otherwise cargo will link against the specified library.
|
|
|
|
///
|
|
|
|
/// The given library name must not contain the `lib` prefix.
|
|
|
|
pub fn cpp_link_stdlib(&mut self, cpp_link_stdlib: Option<&str>) -> &mut Config { |
|
|
|
self.cpp_link_stdlib = Some(cpp_link_stdlib.map(|s| s.into())); |
|
|
|
pub fn cpp_link_stdlib<'a, V: Into<Option<&'a str>>>(&mut self, cpp_link_stdlib: V) -> &mut Config { |
|
|
|
self.cpp_link_stdlib = Some(cpp_link_stdlib.into().map(|s| s.into())); |
|
|
|
self |
|
|
|
} |
|
|
|
|
|
|
@ -410,7 +410,8 @@ impl Config { |
|
|
|
/// be used, otherwise `-stdlib` is added to the compile invocation.
|
|
|
|
///
|
|
|
|
/// The given library name must not contain the `lib` prefix.
|
|
|
|
pub fn cpp_set_stdlib(&mut self, cpp_set_stdlib: Option<&str>) -> &mut Config { |
|
|
|
pub fn cpp_set_stdlib<'a, V: Into<Option<&'a str>>>(&mut self, cpp_set_stdlib: V) -> &mut Config { |
|
|
|
let cpp_set_stdlib = cpp_set_stdlib.into(); |
|
|
|
self.cpp_set_stdlib = cpp_set_stdlib.map(|s| s.into()); |
|
|
|
self.cpp_link_stdlib(cpp_set_stdlib); |
|
|
|
self |
|
|
|