summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--BuildTools/SCons/SConstruct3
-rw-r--r--BuildTools/SCons/Tools/Flags.py10
-rw-r--r--Limber/SConscript14
-rw-r--r--Swiften/QA/ClientTest/SConscript4
-rw-r--r--Swiften/QA/SConscript2
-rw-r--r--Swiften/SConscript6
6 files changed, 25 insertions, 14 deletions
diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct
index 31d74fa..bdb7d48 100644
--- a/BuildTools/SCons/SConstruct
+++ b/BuildTools/SCons/SConstruct
@@ -47,7 +47,7 @@ vars.Add(PathVariable("docbook_xsl", "DocBook XSL", None, PathVariable.PathAccep
# Set up default build & configure environment
################################################################################
-env = Environment(CPPPATH = "#", ENV = {
+env = Environment(CPPPATH = ["#"], ENV = {
'PATH' : os.environ['PATH'],
'LD_LIBRARY_PATH' : os.environ.get("LD_LIBRARY_PATH", ""),
}, variables = vars)
@@ -61,6 +61,7 @@ env["PLATFORM_FLAGS"] = {}
env.Tool("Test", toolpath = ["#/BuildTools/SCons/Tools"])
env.Tool("WriteVal", toolpath = ["#/BuildTools/SCons/Tools"])
env.Tool("BuildVersion", toolpath = ["#/BuildTools/SCons/Tools"])
+env.Tool("Flags", toolpath = ["#/BuildTools/SCons/Tools"])
if env["PLATFORM"] == "darwin" :
env.Tool("Nib", toolpath = ["#/BuildTools/SCons/Tools"])
env.Tool("AppBundle", toolpath = ["#/BuildTools/SCons/Tools"])
diff --git a/BuildTools/SCons/Tools/Flags.py b/BuildTools/SCons/Tools/Flags.py
new file mode 100644
index 0000000..13fbb32
--- /dev/null
+++ b/BuildTools/SCons/Tools/Flags.py
@@ -0,0 +1,10 @@
+import SCons.Util
+
+def generate(env) :
+ def useFlags(env, flags) :
+ for flag in flags :
+ env[flag] = env.get(flag, []) + flags[flag]
+ env.AddMethod(useFlags, "UseFlags")
+
+def exists(env) :
+ return True
diff --git a/Limber/SConscript b/Limber/SConscript
index 0068233..e2fadac 100644
--- a/Limber/SConscript
+++ b/Limber/SConscript
@@ -3,12 +3,12 @@ Import("env")
if env["SCONS_STAGE"] == "build" :
myenv = env.Clone()
myenv.BuildVersion("BuildVersion.h", project = "limber")
- myenv.MergeFlags(env["SWIFTEN_FLAGS"])
- myenv.MergeFlags(env["LIBIDN_FLAGS"])
- myenv.MergeFlags(env.get("LIBXML_FLAGS", ""))
- myenv.MergeFlags(env.get("EXPAT_FLAGS", ""))
- myenv.MergeFlags(env["OPENSSL_FLAGS"])
- myenv.MergeFlags(env["BOOST_FLAGS"])
- myenv.MergeFlags(myenv["PLATFORM_FLAGS"])
+ myenv.UseFlags(env["SWIFTEN_FLAGS"])
+ myenv.UseFlags(env["LIBIDN_FLAGS"])
+ myenv.UseFlags(env.get("LIBXML_FLAGS", ""))
+ myenv.UseFlags(env.get("EXPAT_FLAGS", ""))
+ myenv.UseFlags(env["OPENSSL_FLAGS"])
+ myenv.UseFlags(env["BOOST_FLAGS"])
+ myenv.UseFlags(myenv["PLATFORM_FLAGS"])
myenv.Program("limber", ["main.cpp"])
diff --git a/Swiften/QA/ClientTest/SConscript b/Swiften/QA/ClientTest/SConscript
index 31c4011..15a68c6 100644
--- a/Swiften/QA/ClientTest/SConscript
+++ b/Swiften/QA/ClientTest/SConscript
@@ -4,8 +4,8 @@ Import("env")
if env["TEST"] :
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"])
for i in ["SWIFT_CLIENTTEST_JID", "SWIFT_CLIENTTEST_PASS"]:
if ARGUMENTS.get(i.lower(), False) :
diff --git a/Swiften/QA/SConscript b/Swiften/QA/SConscript
index b885909..4638d6c 100644
--- a/Swiften/QA/SConscript
+++ b/Swiften/QA/SConscript
@@ -7,4 +7,4 @@ SConscript(dirs = [
# "DNSSDTest",
"StorageTest",
"TLSTest",
- ]) \ No newline at end of file
+ ])
diff --git a/Swiften/SConscript b/Swiften/SConscript
index e81309e..080e88e 100644
--- a/Swiften/SConscript
+++ b/Swiften/SConscript
@@ -11,12 +11,12 @@ if env["SCONS_STAGE"] == "flags" :
swiften_env["LIBPATH"] = [Dir(".")]
swiften_env["LIBS"] = ["Swiften"]
dep_env = env.Clone()
- dep_env.MergeFlags(dep_env["PLATFORM_FLAGS"])
for module in ["BOOST", "LIBIDN", "ZLIB", "OPENSSL", "LIBXML", "EXPAT"] :
if env.get(module + "_BUNDLED", False) :
- swiften_env.MergeFlags(env.get(module + "_FLAGS", {}))
+ swiften_env.UseFlags(env.get(module + "_FLAGS", {}))
else :
- dep_env.MergeFlags(env.get(module + "_FLAGS", {}))
+ dep_env.UseFlags(env.get(module + "_FLAGS", {}))
+ dep_env.UseFlags(dep_env["PLATFORM_FLAGS"])
for var, e in [("SWIFTEN_FLAGS", swiften_env), ("SWIFTEN_DEP_FLAGS", dep_env)] :
env[var] = {