summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2012-12-09 16:21:40 (GMT)
committerRemko Tronçon <git@el-tramo.be>2012-12-22 14:25:39 (GMT)
commitd6bb5d79e3726d2aad82b52fe637030177b4950f (patch)
treeb2f4c74a1592825582f82d88d74ae3b85b42665b
parent2b7f55a30b07f08d32bccd3ea0a72ffd8c820c20 (diff)
downloadswift-d6bb5d79e3726d2aad82b52fe637030177b4950f.zip
swift-d6bb5d79e3726d2aad82b52fe637030177b4950f.tar.bz2
Replace MergeFlags calls by UseFlags calls.
Change-Id: If7193006987fd86d102e5e17aac426ef1a6ccd83
-rw-r--r--BuildTools/SCons/Tools/Flags.py5
-rw-r--r--Swiften/Config/SConscript8
-rw-r--r--Swiften/Examples/ConnectivityTest/SConscript4
-rw-r--r--Swiften/Examples/LinkLocalTool/SConscript4
-rw-r--r--Swiften/Examples/ParserTester/SConscript4
-rw-r--r--Swiften/Examples/SendFile/SConscript4
-rw-r--r--Swiften/Examples/SendMessage/SConscript4
-rw-r--r--Swiftob/SConscript6
8 files changed, 21 insertions, 18 deletions
diff --git a/BuildTools/SCons/Tools/Flags.py b/BuildTools/SCons/Tools/Flags.py
index 13fbb32..c130faf 100644
--- a/BuildTools/SCons/Tools/Flags.py
+++ b/BuildTools/SCons/Tools/Flags.py
@@ -3,7 +3,10 @@ import SCons.Util
def generate(env) :
def useFlags(env, flags) :
for flag in flags :
- env[flag] = env.get(flag, []) + flags[flag]
+ if flag in env :
+ env[flag] = env[flag] + flags[flag]
+ else :
+ env[flag] = flags[flag]
env.AddMethod(useFlags, "UseFlags")
def exists(env) :
diff --git a/Swiften/Config/SConscript b/Swiften/Config/SConscript
index 357a5e6..f964993 100644
--- a/Swiften/Config/SConscript
+++ b/Swiften/Config/SConscript
@@ -17,8 +17,8 @@ def cStringVariable(env, cVar, sconsVar) :
config_flags = ""
swiften_env = env.Clone()
-swiften_env.MergeFlags(swiften_env["SWIFTEN_FLAGS"])
-swiften_env.MergeFlags(swiften_env["SWIFTEN_DEP_FLAGS"])
+swiften_env.UseFlags(swiften_env["SWIFTEN_FLAGS"])
+swiften_env.UseFlags(swiften_env["SWIFTEN_DEP_FLAGS"])
cppflags = replaceSwiftenPath(" ".join([swiften_env.subst("$_CPPDEFFLAGS"), swiften_env.subst("$_CPPINCFLAGS")]))
config_flags += cStringVariable(swiften_env, "CPPFLAGS", cppflags)
@@ -29,8 +29,8 @@ config_flags += cStringVariable(swiften_env, "LIBFLAGS", libflags)
config_env = env.Clone()
# Create a local copy of Paths.cpp to avoid a Swiften dependency
config_env.Install(".", "#/Swiften/Base/Paths.cpp")
-config_env.MergeFlags(config_env["BOOST_FLAGS"])
-config_env.MergeFlags(config_env["PLATFORM_FLAGS"])
+config_env.UseFlags(config_env["BOOST_FLAGS"])
+config_env.UseFlags(config_env["PLATFORM_FLAGS"])
config_env.WriteVal("swiften-config.h", config_env.Value(config_flags))
swiften_config = config_env.Program("swiften-config", [
"Paths.cpp",
diff --git a/Swiften/Examples/ConnectivityTest/SConscript b/Swiften/Examples/ConnectivityTest/SConscript
index 7bc3892..55a0821 100644
--- a/Swiften/Examples/ConnectivityTest/SConscript
+++ b/Swiften/Examples/ConnectivityTest/SConscript
@@ -1,7 +1,7 @@
Import("env")
myenv = env.Clone()
-myenv.MergeFlags(myenv["SWIFTEN_FLAGS"])
-myenv.MergeFlags(myenv["SWIFTEN_DEP_FLAGS"])
+myenv.UseFlags(myenv["SWIFTEN_FLAGS"])
+myenv.UseFlags(myenv["SWIFTEN_DEP_FLAGS"])
tester = myenv.Program("ConnectivityTest", ["ConnectivityTest.cpp"])
diff --git a/Swiften/Examples/LinkLocalTool/SConscript b/Swiften/Examples/LinkLocalTool/SConscript
index 788f5c1..18eb91f 100644
--- a/Swiften/Examples/LinkLocalTool/SConscript
+++ b/Swiften/Examples/LinkLocalTool/SConscript
@@ -1,8 +1,8 @@
Import("env")
myenv = env.Clone()
-myenv.MergeFlags(myenv["SWIFTEN_FLAGS"])
-myenv.MergeFlags(myenv["SWIFTEN_DEP_FLAGS"])
+myenv.UseFlags(myenv["SWIFTEN_FLAGS"])
+myenv.UseFlags(myenv["SWIFTEN_DEP_FLAGS"])
linkLocalTool = myenv.Program("LinkLocalTool", [
"main.cpp"
diff --git a/Swiften/Examples/ParserTester/SConscript b/Swiften/Examples/ParserTester/SConscript
index 09cffc9..5c93552 100644
--- a/Swiften/Examples/ParserTester/SConscript
+++ b/Swiften/Examples/ParserTester/SConscript
@@ -1,7 +1,7 @@
Import("env")
myenv = env.Clone()
-myenv.MergeFlags(myenv["SWIFTEN_FLAGS"])
-myenv.MergeFlags(myenv["SWIFTEN_DEP_FLAGS"])
+myenv.UseFlags(myenv["SWIFTEN_FLAGS"])
+myenv.UseFlags(myenv["SWIFTEN_DEP_FLAGS"])
myenv.Program("ParserTester", ["ParserTester.cpp"])
diff --git a/Swiften/Examples/SendFile/SConscript b/Swiften/Examples/SendFile/SConscript
index d335513..e0f1256 100644
--- a/Swiften/Examples/SendFile/SConscript
+++ b/Swiften/Examples/SendFile/SConscript
@@ -1,8 +1,8 @@
Import("env")
myenv = env.Clone()
-myenv.MergeFlags(myenv["SWIFTEN_FLAGS"])
-myenv.MergeFlags(myenv["SWIFTEN_DEP_FLAGS"])
+myenv.UseFlags(myenv["SWIFTEN_FLAGS"])
+myenv.UseFlags(myenv["SWIFTEN_DEP_FLAGS"])
myenv.Program("SendFile", ["SendFile.cpp"])
myenv.Program("ReceiveFile", ["ReceiveFile.cpp"])
diff --git a/Swiften/Examples/SendMessage/SConscript b/Swiften/Examples/SendMessage/SConscript
index 8907d25..0466187 100644
--- a/Swiften/Examples/SendMessage/SConscript
+++ b/Swiften/Examples/SendMessage/SConscript
@@ -1,7 +1,7 @@
Import("env")
myenv = env.Clone()
-myenv.MergeFlags(myenv["SWIFTEN_FLAGS"])
-myenv.MergeFlags(myenv["SWIFTEN_DEP_FLAGS"])
+myenv.UseFlags(myenv["SWIFTEN_FLAGS"])
+myenv.UseFlags(myenv["SWIFTEN_DEP_FLAGS"])
tester = myenv.Program("SendMessage", ["SendMessage.cpp"])
diff --git a/Swiftob/SConscript b/Swiftob/SConscript
index bb056bb..b53057c 100644
--- a/Swiftob/SConscript
+++ b/Swiftob/SConscript
@@ -3,9 +3,9 @@ Import("env")
if env["SCONS_STAGE"] == "build":
myenv = env.Clone()
- myenv.MergeFlags(myenv.get("LUA_FLAGS", {}))
- myenv.MergeFlags(myenv["SWIFTEN_FLAGS"])
- myenv.MergeFlags(myenv["SWIFTEN_DEP_FLAGS"])
+ myenv.UseFlags(myenv.get("LUA_FLAGS", {}))
+ myenv.UseFlags(myenv["SWIFTEN_FLAGS"])
+ myenv.UseFlags(myenv["SWIFTEN_DEP_FLAGS"])
sources = [
"linit.cpp",
"Swiftob.cpp",