Skip to content

Commit

Permalink
feat: enable bytecode compilation of lua in js build
Browse files Browse the repository at this point in the history
this is optimizing the performance of javascript builds of zenroom
  • Loading branch information
jaromil committed Aug 25, 2023
1 parent 671a2fd commit 2d7583a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bindings/javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"scripts": {
"lint": "npx standard",
"build": "run-s build:*",
"build:zenroom": "cd ../.. && make javascript-npm",
"build:zenroom": "cd ../.. && COMPILE_LUA=1 make javascript-npm",
"build:clean": "rimraf dist/*",
"build:copylibs": "mkdirp dist/main && mkdirp dist/module && cp -v ../../build/npm/* dist/main/ && cp -v ../../build/npm/* dist/module",
"build:copylibssrc": "cp -v ../../build/npm/* src/",
Expand Down
4 changes: 3 additions & 1 deletion build/embed-lualibs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ for i in ${(f)libs}; do
print "+ $i $opts"
tmp=`mktemp -d`
if [[ "$opts" = "compile" ]]; then
luac5.3 -o ${tmp}/${n} $i
curl -Ls -o luac54 https://github.com/dyne/luabinaries/releases/latest/download/luac54
chmod +x luac54
./luac54 -o ${tmp}/${n} $i
else
cp $i ${tmp}/${n}
fi
Expand Down

0 comments on commit 2d7583a

Please sign in to comment.