-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCargo.toml
78 lines (73 loc) · 2.15 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
[package]
name = "factini"
version = "0.1.0"
edition = "2018"
[profile.release]
opt-level = 1
debug = true
split-debuginfo = '...' # Platform-specific.
debug-assertions = false
overflow-checks = false
lto = true
panic = 'unwind'
incremental = false
codegen-units = 1
rpath = false
# https://doc.rust-lang.org/cargo/reference/profiles.html
[profile.dev]
opt-level = 1 # 0 will fail with an overflow
embed-bitcode = "no" # faster
debug = true
split-debuginfo = 'off' # Platform-specific.
debug-assertions = true
overflow-checks = false
lto = "off" # skips an optimization step that is slow
panic = 'unwind'
incremental = true
codegen-units = 256
rpath = false
# TODO: copy compilation flags from https://betterprogramming.pub/how-to-pass-arrays-between-javascript-and-wasm-in-rust-9f2eeee7f2b6
[target.'cfg(target_arch = "wasm32")'.dependencies]
futures = "*"
wasm-bindgen = { version = "0.2", features = [] }
# these two are necessary for async in wasm in browser
wasm-bindgen-futures = "0.4.*"
js-sys = "0.3.*"
# enables dumping panics to console.log in js
console_error_panic_hook = "*"
# No support for target-specific lib and none is coming any time soon either: https://github.com/rust-lang/cargo/issues/4881
[lib]
# Error: crate-type must be cdylib to compile to wasm32-unknown-unknown. Add the following to your Cargo.toml file:
crate-type = ["cdylib", "rlib"]
## can't find library `factini`, rename file to `src/lib.rs` or specify lib.path
path = "src/main.rs"
[dependencies.web-sys]
version = "0.3.67"
features = [
'Blob', # for Blob::new_with_str_sequence
'console',
'CanvasPattern',
'CanvasRenderingContext2d',
'CssStyleDeclaration',
'DomRect', # for get_bounding_client_rect
'Document',
'Element',
'EventTarget',
'HtmlCanvasElement',
'HtmlElement',
'HtmlImageElement',
'HtmlInputElement',
'HtmlLabelElement',
'HtmlOptionElement',
'HtmlSelectElement',
'HtmlTextAreaElement',
'MouseEvent',
'Node',
'Performance',
'Storage', # local_storage
'Touch', # touchevent.touches.get
'TouchEvent',
'TouchList', # touchevent.touches
'Window',
'Url', # for Url::create_object_url_with_blob
]