Browse Source

simplify cpp stdlib handling, don't use -stdlib=

add-rc-path
Tim Neumann 10 years ago
parent
commit
c56ccf6a9f
  1. 17
      src/lib.rs

17
src/lib.rs

@ -162,19 +162,16 @@ impl Config {
self
}
/// Set the standard library to use when compiling with C++ support.
/// Set the standard library to link against when compiling with C++
/// support.
///
/// The default value of this property depends on the current target: On
/// OS X `Some("c++")` is used and for other supported targets
/// `Some("stdc++")` is used.
///
/// The choosen library is specified when compiling using the `-stdlib` flag
/// and Cargo is instructed to link to the given library.
///
/// A value of `None` indicates that no special actions regarding the C++
/// standard library should be take. This means that neither are linking
/// instructions provided to Cargo nor is the compiler told to use a
/// specific standard library.
/// standard library should be take. This means that you have to link
/// against the correct standard library yourself if required.
///
/// The given library name must not contain the `lib` prefix.
pub fn cpp_stdlib(&mut self, cpp_stdlib: Option<&str>) -> &mut Config {
@ -294,12 +291,6 @@ impl Config {
}
}
if self.cpp {
if let Some(ref stdlib) = self.cpp_stdlib {
cmd.arg(&format!("-stdlib=lib{}", stdlib));
}
}
for directory in self.include_directories.iter() {
cmd.arg(if target.contains("msvc") {"/I"} else {"-I"});
cmd.arg(directory);

Loading…
Cancel
Save