Commit 6e2f9416 authored by Jordi Coscolla's avatar Jordi Coscolla Committed by Jaromil
Browse files

ADD support for react-native

parent 63817f82
......@@ -46,8 +46,8 @@ apply-patches:
# TODO: improve flags according to
# https://github.com/kripken/emscripten/blob/master/src/settings.js
javascript-node: cflags += -DARCH_JS -D'ARCH=\"JS\"' --memory-init-file 1
javascript-node: ldflags += --memory-init-file 1
Javascript-node: cflags += -DARCH_JS -D'ARCH=\"JS\"' --memory-init-file 1
javascript-node: ldflags += --memory-init-file 1 -s WASM=0
javascript-node: apply-patches lua53 milagro lpeglabel
CC=${gcc} CFLAGS="${cflags}" LDFLAGS="${ldflags}" LDADD="${ldadd}" \
make -C src js
......@@ -55,6 +55,21 @@ javascript-node: apply-patches lua53 milagro lpeglabel
@cp -v src/zenroom.js build/nodejs/
@cp -v src/zenroom.js.mem build/nodejs/
javascript-rn: cflags += -DARCH_JS -D'ARCH=\"JS\"' --memory-init-file 0
javascript-rn: ldflags += -s WASM=0 --memory-init-file 0 -s MEM_INIT_METHOD=0 -s ASSERTIONS=1 -s NO_EXIT_RUNTIME=0 -s LEGACY_VM_SUPPORT=1 -s MODULARIZE=1
javascript-rn: apply-patches lua53 milagro lpeglabel
CC=${gcc} CFLAGS="${cflags}" LDFLAGS="${ldflags}" LDADD="${ldadd}" \
make -C src js
@mkdir -p build/rnjs
sed -i 's/require("crypto")/require(".\/crypto")/g' src/zenroom.js
sed -i 's/require("[^\.]/console.log("/g' src/zenroom.js
sed -i 's/;ENVIRONMENT_IS_SHELL=[^;]*;/;ENVIRONMENT_IS_SHELL=true;/g' src/zenroom.js
sed -i 's/;ENVIRONMENT_IS_NODE=[^;]*;/;ENVIRONMENT_IS_NODE=false;/g' src/zenroom.js
sed -i 's/;ENVIRONMENT_IS_WORKER=[^;]*;/;ENVIRONMENT_IS_WORKER=false;/g' src/zenroom.js
sed -i 's/;ENVIRONMENT_IS_WEB=[^;]*;/;ENVIRONMENT_IS_WEB=false;/g' src/zenroom.js
@cp -v src/zenroom.js build/rnjs/
javascript-wasm: cflags += -DARCH_WASM -D'ARCH=\"WASM\"'
javascript-wasm: ldflags += -s WASM=1 -s MODULARIZE=1
javascript-wasm: apply-patches lua53 milagro lpeglabel
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment