Bug 1635038 - Make wasm-gc properly dependent on reftypes and typed-objects. r=rhunt

Currently our wasm-gc prototypes requires that typed objects are enabled,
and of course it is also dependent on reference types.  So make sure the
default is computed correctly and die during configure if wasm-gc is
requested while the other options are disabled.

Differential Revision: https://phabricator.services.mozilla.com/D77780
This commit is contained in:
Lars T Hansen 2020-06-03 10:45:14 +00:00
Родитель c8f4e4b5d4
Коммит 58d34fe0f0
1 изменённых файлов: 15 добавлений и 5 удалений

Просмотреть файл

@ -551,17 +551,27 @@ set_define('ENABLE_WASM_REFTYPES', depends_if('--enable-wasm-reftypes')(lambda x
# Support for WebAssembly GC.
# ===========================
@depends(milestone.is_nightly, '--enable-wasm-reftypes')
def default_wasm_gc(is_nightly, reftypes):
if reftypes and is_nightly:
@depends(milestone.is_nightly, '--enable-wasm-reftypes', '--enable-typed-objects')
def default_wasm_gc(is_nightly, reftypes, typed_objects):
if is_nightly and reftypes and typed_objects:
return True
js_option('--enable-wasm-gc',
default=default_wasm_gc,
help='{Enable|Disable} WebAssembly GC')
set_config('ENABLE_WASM_GC', depends_if('--enable-wasm-gc')(lambda x: True))
set_define('ENABLE_WASM_GC', depends_if('--enable-wasm-gc')(lambda x: True))
@depends('--enable-wasm-gc', '--enable-wasm-reftypes', '--enable-typed-objects')
def wasm_gc(value, reftypes, typed_objects):
if not value:
return
if reftypes and typed_objects:
return True
die('--enable-wasm-gc only possible with --enable-wasm-reftypes and --enable-typed-objects')
set_config('ENABLE_WASM_GC', wasm_gc)
set_define('ENABLE_WASM_GC', wasm_gc)
# Support for WebAssembly private ref types.