mirror of
https://gitlab.com/veilid/veilid.git
synced 2024-10-01 01:26:08 -04:00
swap around some build thingies
This commit is contained in:
parent
5298fc3fcf
commit
0d7ba1485d
@ -93,7 +93,6 @@ class _MyAppState extends State<MyApp> with UiLoggy {
|
||||
} on Exception {
|
||||
veilidVersion = 'Failed to get veilid version.';
|
||||
}
|
||||
print("veilidVersionString $veilidVersion");
|
||||
|
||||
// In case of hot restart shut down first
|
||||
try {
|
||||
|
@ -36,12 +36,9 @@
|
||||
<body>
|
||||
|
||||
<!-- Load WASM modules -->
|
||||
|
||||
xxx figure out how to switch to debug, maybe do this from dart land
|
||||
|
||||
<script type="module">
|
||||
import * as veilid_wasm_module from './wasm/veilid_wasm.js';
|
||||
async function run() {
|
||||
import * as veilid_wasm_module from './wasm/veilid_wasm.js';
|
||||
// save the wasm exports
|
||||
window.veilid_wasm = veilid_wasm_module;
|
||||
// init the js module
|
||||
|
@ -3,15 +3,7 @@ SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
pushd $SCRIPTDIR &> /dev/null
|
||||
|
||||
if [[ "$1" == "release" ]]; 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
|
||||
if [[ "$1" == "debug" ]]; then
|
||||
OUTPUTDIR=../target/wasm32-unknown-unknown/debug/pkg
|
||||
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-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
|
||||
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
|
||||
|
||||
popd &> /dev/null
|
||||
|
Loading…
Reference in New Issue
Block a user