Skip to content

Commit

Permalink
update build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexErrant committed Feb 12, 2024
1 parent 22e191e commit 36e2872
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ build-std = ['std', 'panic_abort']

[build]
target = "wasm32-unknown-unknown"
rustflags = '-Ctarget-feature=+atomics,+bulk-memory,+mutable-globals'
rustflags = '--cfg web_sys_unstable_apis -Ctarget-feature=+atomics,+bulk-memory,+mutable-globals'
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ path = "./fsrs-rs"
path = "./burn/burn"
default-features = false
features = ["std", "train", "autodiff", "wasm-sync", "browser", "ndarray"]

[profile.release]
codegen-units = 1
lto = "fat"
3 changes: 2 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ fi

# Set optimization flags
if [[ $1 == "release" ]]; then
export RUSTFLAGS="-C lto=fat -C embed-bitcode=yes -C codegen-units=1 -C opt-level=3 --cfg web_sys_unstable_apis"
echo "Building in 'release' mode"
else
echo "Building in 'dev' mode"
# sets $1 to "dev"
set -- dev
fi
Expand Down
4 changes: 1 addition & 3 deletions dev.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/bash

export BUILD_TYPE=--dev

./build.sh
./build.sh dev
4 changes: 1 addition & 3 deletions prod.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/bash

export BUILD_TYPE=--release

./build.sh
./build.sh release

0 comments on commit 36e2872

Please sign in to comment.