Skip to content

Commit 39b1d3e

Browse files
author
Bin Zhang
committed
Merge pull request cocos2d#172 from joshuastray/jsbcc
Added jsbcc for Linux
2 parents 61ea456 + a85cbd2 commit 39b1d3e

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

config.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"version":"v3-console-2",
3-
"zip_file_size":"19102307",
2+
"version":"v3-console-3",
3+
"zip_file_size":"24877075",
44
"repo_name":"console-binary",
55
"repo_parent":"https://github.com/natural-law/"
66
}

plugins/plugin_jscompile/__init__.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import os
1818
import json
1919
import inspect
20+
import platform
2021

2122
import cocos
2223

@@ -112,7 +113,15 @@ def compile_js(self, jsfile, output_file):
112113
Compiles js file
113114
"""
114115
cocos.Logging.debug("compiling js (%s) to bytecode..." % jsfile)
115-
jsbcc_exe_path = os.path.join(self._workingdir, "bin", "jsbcc");
116+
117+
jsbcc_exe_path = ""
118+
if(cocos.os_is_linux()):
119+
if(platform.architecture()[0] == "32bit"):
120+
jsbcc_exe_path = os.path.join(self._workingdir, "bin", "linux", "jsbcc_x86")
121+
else:
122+
jsbcc_exe_path = os.path.join(self._workingdir, "bin", "linux", "jsbcc_x64")
123+
else:
124+
jsbcc_exe_path = os.path.join(self._workingdir, "bin", "jsbcc")
116125

117126
cmd_str = "\"%s\" \"%s\" \"%s\"" % (jsbcc_exe_path, jsfile, output_file)
118127
self._run_cmd(cmd_str)

0 commit comments

Comments
 (0)