mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 14:18:04 +08:00
Fix flags from cargo.toml
This commit is contained in:
@@ -3,14 +3,21 @@
|
||||
output := 'wasm'/'pkg'/'graphite_wasm_bg.wasm'
|
||||
|
||||
build profile='debug':
|
||||
# Build the rust code into the target directory
|
||||
cargo build -p graphite-wasm --lib --target wasm32-unknown-unknown --color=always {{ if profile != "debug" { "--release" } else { "" } }}
|
||||
|
||||
# Create a directory to store the package in
|
||||
mkdir -p pkg
|
||||
|
||||
# Build the JS glue and patch wasm
|
||||
wasm-bindgen \
|
||||
{{ '..' / 'target' / 'wasm32-unknown-unknown' / if profile != "debug" { 'release' / 'graphite_wasm.wasm' } else { 'debug' / 'graphite_wasm.wasm' } }} \
|
||||
--out-dir {{ 'wasm' / 'pkg' }} --typescript --target web {{ if profile == "debug" { "--debug" } else { "" } }}
|
||||
--out-dir {{ 'wasm' / 'pkg' }} --typescript --target web \
|
||||
{{ if profile != "release" { "--debug" } else { "" } }} \
|
||||
{{ if profile == "release" { "--no-demangle" } else { "" } }} \
|
||||
{{ if profile == "profiling" { "--keep-debug" } else { "" } }}
|
||||
|
||||
{{ if profile != 'debug' { "wasm-opt " + output + " -o " + output + " -O" } else { "" } }}
|
||||
# Apply optimisations (if necessary)
|
||||
{{ if profile != 'debug' { "wasm-opt " + output + " -o " + output + " -Os -g" } else { "" } }}
|
||||
|
||||
|
||||
|
||||
@@ -39,30 +39,6 @@ math-parser = { workspace = true }
|
||||
wgpu = { workspace = true }
|
||||
web-sys = { workspace = true }
|
||||
|
||||
[package.metadata.wasm-pack.profile.dev]
|
||||
wasm-opt = false
|
||||
|
||||
[package.metadata.wasm-pack.profile.dev.wasm-bindgen]
|
||||
debug-js-glue = true
|
||||
demangle-name-section = true
|
||||
dwarf-debug-info = false
|
||||
|
||||
[package.metadata.wasm-pack.profile.release]
|
||||
wasm-opt = ["-Os", "-g"]
|
||||
|
||||
[package.metadata.wasm-pack.profile.release.wasm-bindgen]
|
||||
debug-js-glue = false
|
||||
demangle-name-section = false
|
||||
dwarf-debug-info = false
|
||||
|
||||
[package.metadata.wasm-pack.profile.profiling]
|
||||
wasm-opt = ["-Os", "-g"]
|
||||
|
||||
[package.metadata.wasm-pack.profile.profiling.wasm-bindgen]
|
||||
debug-js-glue = true
|
||||
demangle-name-section = true
|
||||
dwarf-debug-info = true
|
||||
|
||||
[lints.rust]
|
||||
unexpected_cfgs = { level = "warn", check-cfg = [
|
||||
'cfg(wasm_bindgen_unstable_test_coverage)',
|
||||
|
||||
Reference in New Issue
Block a user