summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '3rdParty/Lua/SConscript')
-rw-r--r--3rdParty/Lua/SConscript72
1 files changed, 72 insertions, 0 deletions
diff --git a/3rdParty/Lua/SConscript b/3rdParty/Lua/SConscript
new file mode 100644
index 0000000..9d0315e
--- /dev/null
+++ b/3rdParty/Lua/SConscript
@@ -0,0 +1,72 @@
+Import(["env", "conf_env"])
+
+if env.get("LUA_BUNDLED", False) :
+
+################################################################################
+# Module flags
+################################################################################
+
+ if env["SCONS_STAGE"] == "flags" :
+ cppdefines = []
+ if env["PLATFORM"] == "win32" :
+ pass
+ elif env["PLATFORM"] == "darwin" :
+ cppdefines = ["LUA_USE_POSIX", "LUA_USE_DLOPEN"]
+ else :
+ cppdefines = ["LUA_USE_POSIX", "LUA_USE_DLOPEN"]
+
+ env["LUA_FLAGS"] = {
+ "CPPDEFINES": cppdefines,
+ "CPPPATH": [Dir("src")],
+ "LIBPATH": [Dir(".")],
+ "LIBS": ["Swiften_Lua"],
+ }
+
+################################################################################
+# Build
+################################################################################
+
+ if env["SCONS_STAGE"] == "build" :
+ myenv = env.Clone()
+
+ # Remove warn flags
+ myenv.Replace(CCFLAGS = [flag for flag in env["CCFLAGS"] if flag not in ["-W", "-Wall"]])
+
+ myenv.MergeFlags(myenv["LUA_FLAGS"])
+ myenv.StaticLibrary("Swiften_Lua", [
+ "src/lapi.c",
+ "src/lcode.c",
+ "src/ldebug.c",
+ "src/ldo.c",
+ "src/ldump.c",
+ "src/lfunc.c",
+ "src/lgc.c",
+ "src/llex.c",
+ "src/lmem.c",
+ "src/lobject.c",
+ "src/lopcodes.c",
+ "src/lparser.c",
+ "src/lstate.c",
+ "src/lstring.c",
+ "src/ltable.c",
+ "src/ltm.c",
+ "src/lundump.c",
+ "src/lvm.c",
+ "src/lzio.c",
+ "src/lauxlib.c",
+ "src/lbaselib.c",
+ "src/ldblib.c",
+ "src/liolib.c",
+ "src/lmathlib.c",
+ "src/loslib.c",
+ "src/ltablib.c",
+ "src/lstrlib.c",
+ "src/loadlib.c",
+ ])
+
+ lua_env = myenv.Clone()
+ lua_env.MergeFlags(lua_env["LUA_FLAGS"])
+ lua_env.Program("lua", [
+ "src/linit.c",
+ "src/lua.c",
+ ])