You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromSCons.ScriptimportBoolVariable, EnumVariable, Variables, Help
8
-
9
-
env_vars=Variables()
10
-
11
-
env_vars.Add(BoolVariable("luaapi_luajit_build",
12
-
"When LuaAPI is using luaJIT, be default it will attempt to build it automatically. if you prefer you can build it manually and disable auto building with this flag. Make sure to build statically and that the libs are in external/luaJIT/src",
13
-
True))
14
-
15
-
env_vars.Add(EnumVariable("luaapi_host_cc",
16
-
"LuaJIT builds some tools to assist with the rest of the build. You can set the host CC to be used here in the case of cross compilation.", "gcc", ("gcc", "clang")))
17
-
18
-
env_vars.Add(EnumVariable("luaapi_luaver",
19
-
"Build the LuaAPI module with the following lua VM", "5.4", ("5.4", "5.1", "jit")))
20
-
21
-
env_vars.Update(env)
22
-
Help(env_vars.GenerateHelpText(env))
23
-
24
-
defrun(cmd):
25
-
print("Running: %s"%cmd)
26
-
res=os.system(cmd)
27
-
code=0
28
-
if (os.name=='nt'):
29
-
code=res
30
-
else:
31
-
code=os.WEXITSTATUS(res)
32
-
ifcode!=0:
33
-
print("Error: return code: "+str(code))
34
-
sys.exit(code)
35
-
36
-
defbuild_luajit():
37
-
os.chdir("luaJIT")
38
-
# cross compile linux->windows
39
-
ifenv['platform'] =='windows':
40
-
host_arch=platform.machine()
41
-
run("make clean")
42
-
if (host_arch!=env['arch']):
43
-
if (host_arch=='x86_64'andenv['arch'] =='x86_32'):
0 commit comments