From: Matt Corallo Date: Sun, 16 Jan 2022 00:06:17 +0000 (+0000) Subject: Use -O1 on WASM debug builds as they are otherwise too slow to run. X-Git-Tag: v0.0.105.0~2^2~2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=c39fd071b464069346441367eaa2a4a68409a1f7;p=ldk-c-bindings Use -O1 on WASM debug builds as they are otherwise too slow to run. --- diff --git a/genbindings.sh b/genbindings.sh index 45af05a..50b9acf 100755 --- a/genbindings.sh +++ b/genbindings.sh @@ -486,7 +486,7 @@ if [ "$2" = "false" -a "$(rustc --print target-list | grep wasm32-wasi)" != "" ] if clang -nostdlib -o /dev/null --target=wasm32-wasi -Wl,--no-entry genbindings_wasm_test_file.c > /dev/null 2>&1; then # And if it does, build a WASM binary without capturing errors export CFLAGS_wasm32_wasi="$BASE_CFLAGS -target wasm32 -O1" - RUSTFLAGS="$RUSTFLAGS --cfg=test_mod_pointers" cargo build $CARGO_BUILD_ARGS -v --target=wasm32-wasi + RUSTFLAGS="$RUSTFLAGS -C opt-level=1 --cfg=test_mod_pointers" cargo build $CARGO_BUILD_ARGS -v --target=wasm32-wasi export CFLAGS_wasm32_wasi="$BASE_CFLAGS -fembed-bitcode -target wasm32 -Oz" RUSTFLAGS="$RUSTFLAGS -C embed-bitcode=yes -C opt-level=z -C linker-plugin-lto -C lto" CARGO_PROFILE_RELEASE_LTO=true cargo build $CARGO_BUILD_ARGS -v --release --target=wasm32-wasi else