summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-03-16 18:46:51 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-03-16 18:46:51 (GMT)
commit9b55c094105cc2746dc5e4929d3b7c2cd0956a37 (patch)
treed5d67c4f61f3ec6372935d1314776c56d8767ebc /Swiften/SConscript
parent09f48b8434dbdc0d5f55a7f21a55e6ff21f4fa60 (diff)
downloadswift-contrib-9b55c094105cc2746dc5e4929d3b7c2cd0956a37.zip
swift-contrib-9b55c094105cc2746dc5e4929d3b7c2cd0956a37.tar.bz2
Added possibility to dynamically link Swiften.
Resolves: #798
Diffstat (limited to 'Swiften/SConscript')
-rw-r--r--Swiften/SConscript21
1 files changed, 17 insertions, 4 deletions
diff --git a/Swiften/SConscript b/Swiften/SConscript
index 8eeab37..7b8991e 100644
--- a/Swiften/SConscript
+++ b/Swiften/SConscript
@@ -6,12 +6,14 @@ Import("env")
# Flags
################################################################################
+swiften_dep_modules = ["BOOST", "LIBIDN", "ZLIB", "OPENSSL", "LIBXML", "EXPAT"]
+
if env["SCONS_STAGE"] == "flags" :
swiften_env = env.Clone()
swiften_env["LIBPATH"] = [Dir(".")]
swiften_env["LIBS"] = ["Swiften"]
dep_env = env.Clone()
- for module in ["BOOST", "LIBIDN", "ZLIB", "OPENSSL", "LIBXML", "EXPAT"] :
+ for module in swiften_dep_modules :
if env.get(module + "_BUNDLED", False) :
swiften_env.UseFlags(env.get(module + "_FLAGS", {}))
else :
@@ -33,12 +35,20 @@ if env["SCONS_STAGE"] == "flags" :
if env["SCONS_STAGE"] == "build" :
swiften_env = env.Clone()
- swiften_env.MergeFlags(swiften_env["BOOST_FLAGS"])
+ for module in swiften_dep_modules :
+ swiften_env.UseFlags(swiften_env.get(module + "_FLAGS", {}))
+ swiften_env.UseFlags(swiften_env["PLATFORM_FLAGS"])
+ def buildObject(env, sources) :
+ if ARGUMENTS.get("swiften_dll", False) :
+ return env.SharedObject(sources)
+ else :
+ return env.StaticObject(sources)
+ swiften_env.AddMethod(buildObject, "SwiftenObject")
+
Export("swiften_env")
# TODO: Move all this to a submodule SConscript
myenv = swiften_env.Clone()
- myenv.MergeFlags(myenv["ZLIB_FLAGS"])
sources = [
"Chat/ChatStateTracker.cpp",
"Chat/ChatStateNotifier.cpp",
@@ -167,7 +177,10 @@ if env["SCONS_STAGE"] == "build" :
"Examples"
])
- myenv.StaticLibrary("Swiften", sources + swiften_env["SWIFTEN_OBJECTS"])
+ if ARGUMENTS.get("swiften_dll", False) :
+ myenv.SharedLibrary("Swiften", sources + swiften_env["SWIFTEN_OBJECTS"])
+ else :
+ myenv.StaticLibrary("Swiften", sources + swiften_env["SWIFTEN_OBJECTS"])
env.Append(UNITTEST_SOURCES = [
File("Avatars/UnitTest/VCardUpdateAvatarManagerTest.cpp"),