Skip to content

Commit

Permalink
Fix debug build script
Browse files Browse the repository at this point in the history
  • Loading branch information
texodus committed Mar 14, 2022
1 parent af44b35 commit 9ed3233
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rust/perspective-viewer/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ const INHERIT = {

async function build_all() {
await Promise.all(PREBUILD.map(build)).catch(() => process.exit(1));
const debug = process.env.PSP_DEBUG ? "--debug" : "--release";
const cargo_debug = process.env.PSP_DEBUG ? "" : "--release";

// Compile rust
execSync(
`CARGO_TARGET_DIR=./build cargo +nightly build ${debug} --lib --target wasm32-unknown-unknown -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort`,
`CARGO_TARGET_DIR=./build cargo +nightly build ${cargo_debug} --lib --target wasm32-unknown-unknown -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort`,
INHERIT
);

Expand All @@ -142,9 +142,10 @@ async function build_all() {
}

// Generate wasm-bindgen bindings
const wasm_bindgen_debug = process.env.PSP_DEBUG ? "--debug" : "";
const UNOPT_PATH = `build/wasm32-unknown-unknown/release/perspective_viewer.wasm`;
execSync(
`wasm-bindgen ${UNOPT_PATH} --out-dir dist/pkg --typescript --target web`,
`wasm-bindgen ${UNOPT_PATH} ${wasm_bindgen_debug} --out-dir dist/pkg --typescript --target web`,
INHERIT
);

Expand Down

0 comments on commit 9ed3233

Please sign in to comment.