swap around some build thingies

This commit is contained in:
John Smith 2022-03-17 19:03:42 -04:00
parent 5298fc3fcf
commit 0d7ba1485d
3 changed files with 10 additions and 14 deletions

View File

@ -93,7 +93,6 @@ class _MyAppState extends State<MyApp> with UiLoggy {
} on Exception { } on Exception {
veilidVersion = 'Failed to get veilid version.'; veilidVersion = 'Failed to get veilid version.';
} }
print("veilidVersionString $veilidVersion");
// In case of hot restart shut down first // In case of hot restart shut down first
try { try {

View File

@ -36,12 +36,9 @@
<body> <body>
<!-- Load WASM modules --> <!-- Load WASM modules -->
xxx figure out how to switch to debug, maybe do this from dart land
<script type="module"> <script type="module">
async function run() {
import * as veilid_wasm_module from './wasm/veilid_wasm.js'; import * as veilid_wasm_module from './wasm/veilid_wasm.js';
async function run() {
// save the wasm exports // save the wasm exports
window.veilid_wasm = veilid_wasm_module; window.veilid_wasm = veilid_wasm_module;
// init the js module // init the js module

View File

@ -3,15 +3,7 @@ SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
pushd $SCRIPTDIR &> /dev/null pushd $SCRIPTDIR &> /dev/null
if [[ "$1" == "release" ]]; then if [[ "$1" == "debug" ]]; then
OUTPUTDIR=../target/wasm32-unknown-unknown/release/pkg
INPUTDIR=../target/wasm32-unknown-unknown/release
cargo build --target wasm32-unknown-unknown --release
mkdir -p $OUTPUTDIR
wasm-bindgen --out-dir $OUTPUTDIR --target web --no-typescript $INPUTDIR/veilid_wasm.wasm
wasm-strip $OUTPUTDIR/veilid_wasm_bg.wasm
else
OUTPUTDIR=../target/wasm32-unknown-unknown/debug/pkg OUTPUTDIR=../target/wasm32-unknown-unknown/debug/pkg
INPUTDIR=../target/wasm32-unknown-unknown/debug INPUTDIR=../target/wasm32-unknown-unknown/debug
@ -20,6 +12,14 @@ else
wasm-bindgen --out-dir $OUTPUTDIR --target web --no-typescript --keep-debug --debug $INPUTDIR/veilid_wasm.wasm wasm-bindgen --out-dir $OUTPUTDIR --target web --no-typescript --keep-debug --debug $INPUTDIR/veilid_wasm.wasm
./wasm-sourcemap.py $OUTPUTDIR/veilid_wasm_bg.wasm -o $OUTPUTDIR/veilid_wasm_bg.wasm.map --dwarfdump `which llvm-dwarfdump` ./wasm-sourcemap.py $OUTPUTDIR/veilid_wasm_bg.wasm -o $OUTPUTDIR/veilid_wasm_bg.wasm.map --dwarfdump `which llvm-dwarfdump`
wasm-strip $OUTPUTDIR/veilid_wasm_bg.wasm wasm-strip $OUTPUTDIR/veilid_wasm_bg.wasm
else
OUTPUTDIR=../target/wasm32-unknown-unknown/release/pkg
INPUTDIR=../target/wasm32-unknown-unknown/release
cargo build --target wasm32-unknown-unknown --release
mkdir -p $OUTPUTDIR
wasm-bindgen --out-dir $OUTPUTDIR --target web --no-typescript $INPUTDIR/veilid_wasm.wasm
wasm-strip $OUTPUTDIR/veilid_wasm_bg.wasm
fi fi
popd &> /dev/null popd &> /dev/null