-
Notifications
You must be signed in to change notification settings - Fork 28
/
SConscript.luarlvm
61 lines (49 loc) · 1.71 KB
/
SConscript.luarlvm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Main scons file
import shutil
import sys
Import('env')
########################################################## [ Root environment ]
test_env = env.Clone()
test_env.Append(
CPPDEFINES = [
"CASE_SENSITIVE_FILESYSTEM",
"_THREAD_SAFE"
],
CXXFLAGS = [
"--ansi",
"-std=c++17"
]
)
if test_env['PLATFORM'] == 'darwin':
test_env.Append(FRAMEWORKS=["OpenGL"])
else:
test_env.Append(LIBS=["GL", "GLU"])
test_env.ParseConfig("sdl-config --libs")
test_env.Append(CPPPATH = ["#/test"])
config = test_env.Configure()
# Building the luaRlvm test harness requires having lua installed; if we do
# have lua installed, go ahead and use it, but don't really worry if this fails
# since end users don't use this binary.
if config.CheckLibWithHeader('lua5.1', 'lua5.1/lua.h', 'cpp'):
env['BUILD_LUA_TESTS'] = True
else:
print ("Not building luaRlvm. (Don't worry, it's only a testing tool!)")
test_env = config.Finish()
script_machine_files = [
"test/script_machine/script_machine.cc",
"test/script_machine/script_world.cc",
"test/script_machine/luabind_event_system.cc",
"test/script_machine/luabind_graphics_object.cc",
"test/script_machine/luabind_graphics_system.cc",
"test/script_machine/luabind_machine.cc",
"test/script_machine/luabind_system.cc",
"test/script_machine/luabind_utility.cc"
]
if env['BUILD_LUA_TESTS'] == True:
test_env.Append(CPPPATH = [ "/usr/include/lua5.1" ] )
# Build our included copy of luabind.
test_env.BuildSubcomponent("luabind")
test_env.RlvmProgram("lua_rlvm", ['test/lua_rlvm.cc', script_machine_files],
use_lib_set = ["SDL", "LUA"],
rlvm_libs = ["system_sdl", "rlvm"])
test_env.Install('$OUTPUT_DIR', 'lua_rlvm')