diff options
Diffstat (limited to 'Sluift')
-rw-r--r-- | Sluift/SConscript | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/Sluift/SConscript b/Sluift/SConscript index 816c234..eeb2f24 100644 --- a/Sluift/SConscript +++ b/Sluift/SConscript @@ -1,7 +1,16 @@ Import(["env", "conf_env"]) if env["SCONS_STAGE"] == "build" : + lib_env = env.Clone() + lib_env.UseFlags(env["LUA_FLAGS"]) + lib_env.UseFlags(env["SWIFTEN_FLAGS"]) + lib_env.UseFlags(env["SWIFTEN_DEP_FLAGS"]) + sluift_lib = lib_env.StaticLibrary("SluiftCore", [ + "sluift.cpp" + ]); + myenv = env.Clone() + myenv.Append(LIBS = sluift_lib) myenv.UseFlags(env["LUA_FLAGS"]) myenv.UseFlags(env["SWIFTEN_FLAGS"]) myenv.UseFlags(env["SWIFTEN_DEP_FLAGS"]) @@ -11,10 +20,6 @@ if env["SCONS_STAGE"] == "build" : elif myenv["PLATFORM"] == "darwin" : myenv["SHLIBSUFFIX"] = ".so" - sluift_lib = myenv.StaticLibrary("SluiftCore", [ - "sluift.cpp" - ]); - def patchLua(env, target, source) : f = open(source[0].abspath, "r") contents = f.read() @@ -25,17 +30,13 @@ if env["SCONS_STAGE"] == "build" : f.write(contents) f.close() - sluift_bin_env = myenv.Clone() - sluift_bin_env.Append(LIBS = sluift_lib) - sluift_bin_env.Command("lua.c", ["#/3rdParty/Lua/src/lua.c"], env.Action(patchLua, cmdstr = "$GENCOMSTR")) - if sluift_bin_env.get("HAVE_READLINE", False) : - sluift_bin_env.Append(CPPDEFINES = ["LUA_USE_READLINE"]) - sluift_bin_env.MergeFlags(sluift_bin_env["READLINE_FLAGS"]) - env["SLUIFT"] = sluift_bin_env.Program("sluift", [ + myenv.Command("lua.c", ["#/3rdParty/Lua/src/lua.c"], env.Action(patchLua, cmdstr = "$GENCOMSTR")) + if myenv.get("HAVE_READLINE", False) : + myenv.Append(CPPDEFINES = ["LUA_USE_READLINE"]) + myenv.MergeFlags(myenv["READLINE_FLAGS"]) + env["SLUIFT"] = myenv.Program("sluift", [ "lua.c", "linit.c", ]) - sluift_dll_env = myenv.Clone() - sluift_dll_env.Append(LIBS = sluift_lib) - sluift_dll_env.SharedLibrary("sluift", []); + myenv.SharedLibrary("sluift", []); |