Skip to content

Commit

Permalink
Merge pull request cocos2d#172 from joshuastray/jsbcc
Browse files Browse the repository at this point in the history
Added jsbcc for Linux
  • Loading branch information
Bin Zhang committed Nov 11, 2014
2 parents 61ea456 + a85cbd2 commit 39b1d3e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version":"v3-console-2",
"zip_file_size":"19102307",
"version":"v3-console-3",
"zip_file_size":"24877075",
"repo_name":"console-binary",
"repo_parent":"https://github.com/natural-law/"
}
11 changes: 10 additions & 1 deletion plugins/plugin_jscompile/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import os
import json
import inspect
import platform

import cocos

Expand Down Expand Up @@ -112,7 +113,15 @@ def compile_js(self, jsfile, output_file):
Compiles js file
"""
cocos.Logging.debug("compiling js (%s) to bytecode..." % jsfile)
jsbcc_exe_path = os.path.join(self._workingdir, "bin", "jsbcc");

jsbcc_exe_path = ""
if(cocos.os_is_linux()):
if(platform.architecture()[0] == "32bit"):
jsbcc_exe_path = os.path.join(self._workingdir, "bin", "linux", "jsbcc_x86")
else:
jsbcc_exe_path = os.path.join(self._workingdir, "bin", "linux", "jsbcc_x64")
else:
jsbcc_exe_path = os.path.join(self._workingdir, "bin", "jsbcc")

cmd_str = "\"%s\" \"%s\" \"%s\"" % (jsbcc_exe_path, jsfile, output_file)
self._run_cmd(cmd_str)
Expand Down

0 comments on commit 39b1d3e

Please sign in to comment.