Remove debug sections by default

The changes on master Rust insert debug sections now (yay!) but this means that
wasm binaries by default pick up debug sections from the standard library, so
let's remove them by default in wasm-bindgen unless `--debug` is passed
This commit is contained in:
Alex Crichton
2018-07-13 08:10:51 -07:00
parent 04ad5bc727
commit 133706fc5c
4 changed files with 12 additions and 1 deletions

View File

@ -31,6 +31,7 @@ pub struct Bindgen {
debug: bool,
typescript: bool,
demangle: bool,
keep_debug: bool,
}
impl Bindgen {
@ -45,6 +46,7 @@ impl Bindgen {
debug: false,
typescript: false,
demangle: true,
keep_debug: false,
}
}
@ -93,6 +95,11 @@ impl Bindgen {
self
}
pub fn keep_debug(&mut self, keep_debug: bool) -> &mut Bindgen {
self.keep_debug = keep_debug;
self
}
pub fn generate<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error> {
self._generate(path.as_ref())
}