From a4bec933859e452acd2c18e4152ac2a6a95e806f Mon Sep 17 00:00:00 2001
From: Ian Purvis <ian@purvisresearch.com>
Date: Wed, 16 Sep 2020 16:00:01 -0500
Subject: [PATCH] Adds _malloc to emscripten EXPORTED_FUNCTIONS (#335)

Fixes 'b._malloc is not a function' when building with emscripten 2.0.4
---
 CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index de6883c04..addb88a3a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,6 +41,7 @@ set(EMCC_ARGS
   -O3
   -s ALLOW_MEMORY_GROWTH=${ALLOW_MEMORY_GROWTH}
   -s ALLOW_TABLE_GROWTH=1
+  -s EXPORTED_FUNCTIONS=["_malloc"]
   -s EXPORTED_RUNTIME_METHODS=["UTF8ToString"]
   -s EXTRA_EXPORTED_RUNTIME_METHODS=["addFunction"]
   -s EXPORT_NAME="Ammo"