blob: faad0879c690f65a492d77693858342a40216764 [file] [log] [blame]
Marat Dukhan08c4a432019-10-03 09:29:21 -07001"""Emscripten-specific build definitions for XNNPACK."""
2
3def xnnpack_emscripten_minimal_linkopts():
4 """Minimal Emscripten-specific linkopts for binaries."""
5 return [
6 "-s ASSERTIONS=0",
7 "-s ERROR_ON_UNDEFINED_SYMBOLS=1",
8 "-s EXIT_RUNTIME=1",
9 ]
10
11def xnnpack_emscripten_test_linkopts():
12 """Emscripten-specific linkopts for unit tests."""
13 return [
14 "-s ASSERTIONS=2",
15 "-s ERROR_ON_UNDEFINED_SYMBOLS=1",
16 "-s DEMANGLE_SUPPORT=1",
17 "-s EXIT_RUNTIME=1",
18 "-s ALLOW_MEMORY_GROWTH=1",
19 "--pre-js $(location :preamble.js.lds)",
20 ]
21
22def xnnpack_emscripten_benchmark_linkopts():
23 """Emscripten-specific linkopts for benchmarks."""
24 return [
25 "-s ASSERTIONS=1",
26 "-s ERROR_ON_UNDEFINED_SYMBOLS=1",
27 "-s EXIT_RUNTIME=1",
28 "-s ALLOW_MEMORY_GROWTH=1",
Marat Dukhanc08cdf52019-12-09 09:17:51 -080029 "-s TOTAL_MEMORY=268435456", # 256M
Marat Dukhan08c4a432019-10-03 09:29:21 -070030 "--pre-js $(location :preamble.js.lds)",
31 ]
32
33def xnnpack_emscripten_deps():
34 """Emscripten-specific dependencies for unit tests and benchmarks."""
35 return [
36 ":preamble.js.lds",
37 ]