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

@ -32,6 +32,7 @@ Options:
--no-typescript Don't emit a *.d.ts file
--debug Include otherwise-extraneous debug checks in output
--no-demangle Don't demangle Rust symbol names
--keep-debug Keep debug sections in wasm files
-V --version Print the version number of wasm-bindgen
";
@ -47,6 +48,7 @@ struct Args {
flag_version: bool,
flag_no_demangle: bool,
flag_no_modules_global: Option<String>,
flag_keep_debug: bool,
arg_input: Option<PathBuf>,
}
@ -85,6 +87,7 @@ fn rmain(args: &Args) -> Result<(), Error> {
.no_modules(args.flag_no_modules)
.debug(args.flag_debug)
.demangle(!args.flag_no_demangle)
.keep_debug(args.flag_keep_debug)
.typescript(typescript);
if let Some(ref name) = args.flag_no_modules_global {
b.no_modules_global(name);