summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-09-24 18:18:28 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-09-25 17:42:32 (GMT)
commit94f87ffc9769f2782b2267db813854b0fe752678 (patch)
tree56244712ade2be0d4a0a093d7721d18050e74f87 /BuildTools/SCons
parent4f62e5ec4b42929fe3c1a68667e63cb1b7a35509 (diff)
downloadswift-94f87ffc9769f2782b2267db813854b0fe752678.zip
swift-94f87ffc9769f2782b2267db813854b0fe752678.tar.bz2
File transfer changes.
- Introduce 'experimental' flag to conditionally compile FT. - Use LibMiniUPNPC and NATPMP CPPDEFINES only locally in the classes that need them. - Extract abstract interface from NAT traversal classes - Avoid unit test warnings
Diffstat (limited to 'BuildTools/SCons')
-rw-r--r--BuildTools/SCons/SConscript.boot4
-rw-r--r--BuildTools/SCons/SConstruct33
2 files changed, 22 insertions, 15 deletions
diff --git a/BuildTools/SCons/SConscript.boot b/BuildTools/SCons/SConscript.boot
index 77b1cf1..366981c 100644
--- a/BuildTools/SCons/SConscript.boot
+++ b/BuildTools/SCons/SConscript.boot
@@ -52,6 +52,7 @@ vars.Add(PathVariable("docbook_xml", "DocBook XML", None, PathVariable.PathAccep
vars.Add(PathVariable("docbook_xsl", "DocBook XSL", None, PathVariable.PathAccept))
vars.Add(BoolVariable("build_examples", "Build example programs", "yes"))
vars.Add(BoolVariable("enable_variants", "Build in a separate dir under build/, depending on compile flags", "no"))
+vars.Add(BoolVariable("experimental", "Build experimental features", "no"))
################################################################################
# Set up default build & configure environment
@@ -162,6 +163,9 @@ if env.get("mac105", 0) :
if not env["assertions"] :
env.Append(CPPDEFINES = ["NDEBUG"])
+if env["experimental"] :
+ env.Append(CPPDEFINES = ["SWIFT_EXPERIMENTAL_FT"])
+
# If we build shared libs on AMD64, we need -fPIC.
# This should have no performance impact om AMD64
if env["PLATFORM"] == "posix" and platform.machine() == "x86_64" :
diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct
index ba2f4b7..448bdbd 100644
--- a/BuildTools/SCons/SConstruct
+++ b/BuildTools/SCons/SConstruct
@@ -312,25 +312,28 @@ else :
conf.Finish()
# LibMiniUPnPc
-libminiupnpc_conf_env = conf_env.Clone()
-
-conf = Configure(libminiupnpc_conf_env)
-if conf.CheckCHeader("miniupnpc.h") and conf.CheckLib(env["libminiupnpc_libname"]) :
- print "NOT IMPLEMENTED YET"
+if env["experimental"] :
+ libminiupnpc_conf_env = conf_env.Clone()
+ conf = Configure(libminiupnpc_conf_env)
+ if conf.CheckCHeader("miniupnpc.h") and conf.CheckLib(env["libminiupnpc_libname"]) :
+ print "NOT IMPLEMENTED YET"
+ else :
+ env["LIBMINIUPNPC_BUNDLED"] = 1
+ conf.Finish()
else :
- env["LIBMINIUPNPC_BUNDLED"] = 1
-conf.Finish()
+ env["LIBMINIUPNPC_FLAGS"] = {}
# LibNATPMP
-libnatpmp_conf_env = conf_env.Clone()
-
-conf = Configure(libnatpmp_conf_env)
-if conf.CheckCHeader("natpmp.h") and conf.CheckLib(env["libnatpmp_libname"]) :
- print "NOT IMPLEMENTED YET"
+if env["experimental"] :
+ libnatpmp_conf_env = conf_env.Clone()
+ conf = Configure(libnatpmp_conf_env)
+ if conf.CheckCHeader("natpmp.h") and conf.CheckLib(env["libnatpmp_libname"]) :
+ print "NOT IMPLEMENTED YET"
+ else :
+ env["LIBNATPMP_BUNDLED"] = 1
+ conf.Finish()
else :
- env["LIBNATPMP_BUNDLED"] = 1
-conf.Finish()
-
+ env["LIBNATPMP_FLAGS"] = {}
# SQLite
#sqlite_conf_env = conf_env.Clone()