summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-08-29 18:06:03 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-08-29 18:08:06 (GMT)
commitbf9cfb6aa5bda0a33da6dfc12ef49321500256ed (patch)
treef65132bd5b1a27d54bd78858908ed6ae38b8fbc4 /BuildTools/SCons
parent46b13c4d25270c6933d20c6aa790619e30e4cfe8 (diff)
downloadswift-bf9cfb6aa5bda0a33da6dfc12ef49321500256ed.zip
swift-bf9cfb6aa5bda0a33da6dfc12ef49321500256ed.tar.bz2
Put platform flags in PLATFORM_FLAGS variable.
This should avoid problems with --as-needed. Resolves: #547
Diffstat (limited to 'BuildTools/SCons')
-rw-r--r--BuildTools/SCons/SConstruct14
1 files changed, 8 insertions, 6 deletions
diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct
index 98feccd..5a64f2d 100644
--- a/BuildTools/SCons/SConstruct
+++ b/BuildTools/SCons/SConstruct
@@ -47,6 +47,9 @@ env = Environment(CPPPATH = "#", ENV = {
Help(vars.GenerateHelpText(env))
+# Default environment variables
+env["PLATFORM_FLAGS"] = {}
+
# Default custom tools
env.Tool("Test", toolpath = ["#/BuildTools/SCons/Tools"])
env.Tool("WriteVal", toolpath = ["#/BuildTools/SCons/Tools"])
@@ -275,16 +278,15 @@ if not conf.CheckCXX() or not conf.CheckCC() :
env["HAVE_ZLIB"] = True
if conf.CheckLib("z") :
- env.Append(LIBS = "z")
- env["ZLIB_FLAGS"] = ""
+ env["ZLIB_FLAGS"] = {"LIBS": ["z"]}
else :
env["ZLIB_BUNDLED"] = True
-if conf.CheckLib("c") :
- env.Append(LIBS = ["c"])
-
if conf.CheckLib("resolv") :
- env.Append(LIBS = ["resolv"])
+ env["PLATFORM_FLAGS"]["LIBS"] = env["PLATFORM_FLAGS"].get("LIBS", []) + ["resolv"]
+
+if conf.CheckLib("c") :
+ env["PLATFORM_FLAGS"]["LIBS"] = env["PLATFORM_FLAGS"].get("LIBS", []) + ["c"]
# LibIDN
if conf.CheckCHeader("idna.h") and conf.CheckLib("idn") :