[build] Introduce gn arg to disable WebAssembly
For now, that flag only avoid the installation of the 'WebAssembly' global. Follow-up CLs will remove unneeded code from the binary if the gn arg is not set to true. R=ecmziegler@chromium.org, machenbach@chromium.org Bug: v8:11238, v8:11344 Change-Id: Ie95b608ed12b0476470cb552138e369f863d249b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2646833 Commit-Queue: Clemens Backes <clemensb@chromium.org> Reviewed-by: Michael Achenbach <machenbach@chromium.org> Reviewed-by: Emanuel Ziegler <ecmziegler@chromium.org> Cr-Commit-Position: refs/heads/master@{#72296}
This commit is contained in:
parent
5d1a7c6440
commit
2777148271
8
BUILD.gn
8
BUILD.gn
@ -289,6 +289,11 @@ declare_args() {
|
||||
# If enabled then macro definitions that are used in externally visible
|
||||
# header files are placed in a separate header file v8-gn.h.
|
||||
v8_generate_external_defines_header = false
|
||||
|
||||
# Include support for WebAssembly. If disabled, the 'WebAssembly' global
|
||||
# will not be available, and embedder APIs to generate WebAssembly modules
|
||||
# will fail.
|
||||
v8_enable_webassembly = true
|
||||
}
|
||||
|
||||
# Derived defaults.
|
||||
@ -755,6 +760,9 @@ config("features") {
|
||||
if (v8_etw_guid != "") {
|
||||
defines += [ "V8_ETW_GUID=\"$v8_etw_guid\"" ]
|
||||
}
|
||||
if (v8_enable_webassembly) {
|
||||
defines += [ "V8_ENABLE_WEBASSEMBLY" ]
|
||||
}
|
||||
}
|
||||
|
||||
config("toolchain") {
|
||||
|
@ -782,7 +782,11 @@ DEFINE_BOOL(untrusted_code_mitigations, V8_DEFAULT_UNTRUSTED_CODE_MITIGATIONS,
|
||||
DEFINE_BOOL(wasm_generic_wrapper, true,
|
||||
"allow use of the generic js-to-wasm wrapper instead of "
|
||||
"per-signature wrappers")
|
||||
#ifdef V8_ENABLE_WEBASSEMBLY
|
||||
DEFINE_BOOL(expose_wasm, true, "expose wasm interface to JavaScript")
|
||||
#else
|
||||
DEFINE_BOOL(expose_wasm, false, "expose wasm interface to JavaScript")
|
||||
#endif
|
||||
DEFINE_INT(wasm_num_compilation_tasks, 128,
|
||||
"maximum number of parallel compilation tasks for wasm")
|
||||
DEFINE_DEBUG_BOOL(trace_wasm_native_heap, false,
|
||||
|
Loading…
Reference in New Issue
Block a user