summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-03-01 20:17:23 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-03-01 20:17:23 (GMT)
commitca3f25d09a703ff7c27267a5591ce5379886e1c9 (patch)
treeb14c38655ea3c61beb79f8a895fc7e6ce2989a9e /Sluift/SConscript
parent5ad284705760c451012a5d896251af538e7bcede (diff)
downloadswift-contrib-ca3f25d09a703ff7c27267a5591ce5379886e1c9.zip
swift-contrib-ca3f25d09a703ff7c27267a5591ce5379886e1c9.tar.bz2
Some more Sluift enhancements.
Diffstat (limited to 'Sluift/SConscript')
-rw-r--r--Sluift/SConscript17
1 files changed, 8 insertions, 9 deletions
diff --git a/Sluift/SConscript b/Sluift/SConscript
index 44fabdf..816c234 100644
--- a/Sluift/SConscript
+++ b/Sluift/SConscript
@@ -6,12 +6,15 @@ if env["SCONS_STAGE"] == "build" :
myenv.UseFlags(env["SWIFTEN_FLAGS"])
myenv.UseFlags(env["SWIFTEN_DEP_FLAGS"])
myenv["SHLIBPREFIX"] = ""
-
if myenv["PLATFORM"] == "win32" :
myenv.Append(CPPDEFINES = ["SLUIFT_BUILD_DLL"])
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()
@@ -23,20 +26,16 @@ if env["SCONS_STAGE"] == "build" :
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", [
- "sluift.cpp",
"lua.c",
"linit.c",
])
- # Create a copy of sluift.cpp to avoid conflicting targets
- # Ideally, we would use variants for this
- myenv.InstallAs("sluift_dll.cpp", "sluift.cpp")
- myenv.SharedLibrary("sluift", [
- "sluift_dll.cpp",
- ])
-
+ sluift_dll_env = myenv.Clone()
+ sluift_dll_env.Append(LIBS = sluift_lib)
+ sluift_dll_env.SharedLibrary("sluift", []);