blob: 57080a07db0124430b26cd6092b7720d4a44f581 [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 Dukhan12f1dea2019-10-04 14:44:59 -070029 "-s TOTAL_MEMORY=134217728", # 128M
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 ]