Skip to content

Commit

Permalink
compile scripts with luac as default
Browse files Browse the repository at this point in the history
  • Loading branch information
SunLightJuly committed Dec 16, 2014
1 parent fb3c4ee commit 1a9c453
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion bin/lib/compile_scripts.php
Expand Up @@ -15,7 +15,7 @@
array('ex', 'extname', 1, 'lua', 'encrypted file extension name (default is "lua"), only valid for xxtea_chunk'),
array('c', 'config', 1, null, 'load options from config file'),
array('q', 'quiet', 0, false, 'quiet'),
array('luac', 'luac', 0, false, 'using luac compile framework'),
array('jit', 'jit', 0, false, 'using luajit compile framework'),
);

function errorhelp()
Expand Down
2 changes: 1 addition & 1 deletion bin/lib/quick/ScriptsCompiler.php
Expand Up @@ -258,7 +258,7 @@ protected function compileModules(array $modules, $key = null, $sign = null)
$modulesBytes = array();
foreach ($modules as $path => $module)
{
$bytes = getScriptFileBytecodes($path, $module['tempFilePath'], $this->config['luac']);
$bytes = getScriptFileBytecodes($path, $module['tempFilePath'], $this->config['jit']);
if ($xxtea)
{
$bytes = $sign . $xxtea->encrypt($bytes);
Expand Down
4 changes: 2 additions & 2 deletions bin/lib/quick/init.php
Expand Up @@ -143,7 +143,7 @@ function findFiles($dir, array & $files)
closedir($dh);
}

function getScriptFileBytecodes($path, $tmpfile, $usingluac = 0)
function getScriptFileBytecodes($path, $tmpfile, $usingluajit = 0)
{
if (!file_exists($path))
{
Expand All @@ -162,7 +162,7 @@ function getScriptFileBytecodes($path, $tmpfile, $usingluac = 0)

@mkdir(pathinfo($tmpfile, PATHINFO_DIRNAME), 0777, true);

if ($usingluac == 0)
if ($usingluajit != 0)
{
$command = sprintf('%s -b -s "%s" "%s"', LUAJIT_BIN, $path, $tmpfile);
}
Expand Down
2 changes: 1 addition & 1 deletion bin/make_framework_package.sh
@@ -1,7 +1,7 @@
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIR/../"
"$DIR/compile_scripts.sh" -i framework -o lib/framework_precompiled/framework_precompiled.zip -p framework -m zip -luac
"$DIR/compile_scripts.sh" -i framework -o lib/framework_precompiled/framework_precompiled.zip -p framework -m zip

echo ""
echo "### UPDATING ###"
Expand Down
20 changes: 10 additions & 10 deletions setup_mac.sh
Expand Up @@ -60,16 +60,16 @@ if [ "$CALL_BY_PKG" != "" ]; then
$QUICK_COCOS2DX_ROOT/bin/install_luajit.sh
ln -s $QUICK_COCOS2DX_ROOT/player/mac/player.app $QUICK_COCOS2DX_ROOT/player.app

else

while true; do
read -p "Do you wish to install LuaJIT (Y/N) ? " yn
case $yn in
[Yy]* ) echo ""; $QUICK_COCOS2DX_ROOT/bin/install_luajit.sh; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
# else

# while true; do
# read -p "Do you wish to install LuaJIT (Y/N) ? " yn
# case $yn in
# [Yy]* ) echo ""; $QUICK_COCOS2DX_ROOT/bin/install_luajit.sh; break;;
# [Nn]* ) exit;;
# * ) echo "Please answer yes or no.";;
# esac
# done

fi;

Expand Down

0 comments on commit 1a9c453

Please sign in to comment.