-
Notifications
You must be signed in to change notification settings - Fork 372
/
emscripten.bzl
43 lines (39 loc) · 1.29 KB
/
emscripten.bzl
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
"""Emscripten-specific build definitions for XNNPACK."""
def xnnpack_emscripten_minimal_linkopts():
"""Minimal Emscripten-specific linkopts for binaries."""
return [
"-s ASSERTIONS=0",
"-s ENVIRONMENT=node,shell,web",
"-s ERROR_ON_UNDEFINED_SYMBOLS=1",
"-s EXIT_RUNTIME=1",
]
def xnnpack_emscripten_test_linkopts():
"""Emscripten-specific linkopts for unit tests."""
return [
"-s ALLOW_MEMORY_GROWTH=1",
"-s ASSERTIONS=2",
"-s ENVIRONMENT=node,shell,web",
"-s ERROR_ON_UNDEFINED_SYMBOLS=1",
"-s EXIT_RUNTIME=1",
"-s STACK_SIZE=5MB",
"-s TEXTDECODER=1",
"--pre-js $(location //:preamble.js.lds)",
]
def xnnpack_emscripten_benchmark_linkopts():
"""Emscripten-specific linkopts for benchmarks."""
return [
"-s ASSERTIONS=1",
"-s ENVIRONMENT=node,shell,web",
"-s ERROR_ON_UNDEFINED_SYMBOLS=1",
"-s EXIT_RUNTIME=1",
"-s ALLOW_MEMORY_GROWTH=1",
"-s INITIAL_MEMORY=1gb",
"-s MAXIMUM_MEMORY=4gb",
"-s TEXTDECODER=1",
"--pre-js $(location //:preamble.js.lds)",
]
def xnnpack_emscripten_deps():
"""Emscripten-specific dependencies for unit tests and benchmarks."""
return [
"//:preamble.js.lds",
]