diff --git a/src/mono/browser/build/BrowserWasmApp.targets b/src/mono/browser/build/BrowserWasmApp.targets index 8eb51b41fe8d2..728c600a74022 100644 --- a/src/mono/browser/build/BrowserWasmApp.targets +++ b/src/mono/browser/build/BrowserWasmApp.targets @@ -63,6 +63,15 @@ + + + + + all + + + + diff --git a/src/mono/browser/runtime/driver.c b/src/mono/browser/runtime/driver.c index 2a1d5b1dbbf16..9db8a39d24c6a 100644 --- a/src/mono/browser/runtime/driver.c +++ b/src/mono/browser/runtime/driver.c @@ -180,9 +180,12 @@ cleanup_runtime_config (MonovmRuntimeConfigArguments *args, void *user_data) free (user_data); } +static int runtime_initialized = 0; + EMSCRIPTEN_KEEPALIVE void mono_wasm_load_runtime (int debug_level) { + runtime_initialized = 1; const char *interp_opts = ""; #ifndef INVARIANT_GLOBALIZATION @@ -227,6 +230,15 @@ mono_wasm_load_runtime (int debug_level) bindings_initialize_internals(); } +int initialize_runtime() +{ + if (runtime_initialized == 1) + return 0; + mono_wasm_load_runtime (0); + + return 0; +} + EMSCRIPTEN_KEEPALIVE void mono_wasm_invoke_jsexport (MonoMethod *method, void* args) {