Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52759 - in sandbox/SCons: . libs tools/scons
From: loonycyborg_at_[hidden]
Date: 2009-05-04 17:49:08


Author: loonycyborg
Date: 2009-05-04 17:49:07 EDT (Mon, 04 May 2009)
New Revision: 52759
URL: http://svn.boost.org/trac/boost/changeset/52759

Log:
Added a rule to build one of boost.filesystem regression tests.

Added:
   sandbox/SCons/tools/scons/boost-tests.py (contents, props changed)
Text files modified:
   sandbox/SCons/SConstruct | 2 +-
   sandbox/SCons/libs/SConscript | 13 ++++++++++---
   sandbox/SCons/tools/scons/boost-libs.py | 7 +++++--
   3 files changed, 16 insertions(+), 6 deletions(-)

Modified: sandbox/SCons/SConstruct
==============================================================================
--- sandbox/SCons/SConstruct (original)
+++ sandbox/SCons/SConstruct 2009-05-04 17:49:07 EDT (Mon, 04 May 2009)
@@ -10,7 +10,7 @@
     PathVariable("stagedir", "If --stage is passed install only compiled library files in this location", "stage", PathVariable.PathAccept),
     PathVariable("prefix", "Install prefix", "/usr/local", PathVariable.PathAccept)
 )
-env = Environment(toolpath = ["tools/scons"], tools = ["default", "boost-libs", "boost-build-variants", "boost-configure"], variables = vars, config_log = "$BOOST_BUILD_DIR/config.log")
+env = Environment(toolpath = ["tools/scons"], tools = ["default", "boost-libs", "boost-build-variants", "boost-configure", "boost-tests"], variables = vars, config_log = "$BOOST_BUILD_DIR/config.log")
 vars.Save("build-config.py", env)
 Export("env")
 

Modified: sandbox/SCons/libs/SConscript
==============================================================================
--- sandbox/SCons/libs/SConscript (original)
+++ sandbox/SCons/libs/SConscript 2009-05-04 17:49:07 EDT (Mon, 04 May 2009)
@@ -6,8 +6,10 @@
     )
 
 sconscripts = Glob("*/build/SConscript")
+test_sconscripts = Glob("*/test/SConscript")
 env.AppendUnique(CPPDEFINES = ["${LINK_DYNAMIC and 'BOOST_' + BOOST_LIB + '_DYN_LINK=1' or []}"])
 for variant in env["variant"]:
+ env["current_variant"] = variant
     env.SetProperty(profile = False)
     if variant == "release":
         env.SetProperty(optimize = "speed", debug = False)
@@ -16,16 +18,21 @@
     elif variant == "profile":
         env.SetProperty(optimize = "speed", profile = True, debug = True)
     for linking in env["link"]:
+ env["linking"] = linking
         if linking == "dynamic":
             env["LINK_DYNAMIC"] = True
         else:
             env["LINK_DYNAMIC"] = False
         for threading in env["threading"]:
+ env["current_threading"] = threading
             env.SetProperty(threading = threading)
 
- target_dir = env["BOOST_BUILD_DIR"] + "/libs/" + variant + "/" + linking + "/threading-" + threading
- VariantDir(src_dir = ".", variant_dir = target_dir, duplicate = False)
+ env.VariantDir(src_dir = ".", variant_dir = "$BOOST_CURRENT_VARIANT_DIR", duplicate = False)
             for sconscript in sconscripts:
                 lib = str(sconscript.get_dir().up())
                 VariantDir(src_dir = lib + "/build", variant_dir = lib + "/src", duplicate = False)
- SConscript(target_dir + "/" + lib + "/src/SConscript", exports = { "env" : env.Clone(BOOST_LIB = lib.upper()) })
+ env.SConscript("$BOOST_CURRENT_VARIANT_DIR/" + lib + "/src/SConscript", exports = { "env" : env.Clone(BOOST_LIB = lib.upper()) })
+ if GetOption("test"):
+ for sconscript in test_sconscripts:
+ lib = str(sconscript.get_dir().up())
+ env.SConscript("$BOOST_CURRENT_VARIANT_DIR/" + lib + "/test/SConscript", exports = { "env" : env.Clone(BOOST_LIB = lib.upper()) })

Modified: sandbox/SCons/tools/scons/boost-libs.py
==============================================================================
--- sandbox/SCons/tools/scons/boost-libs.py (original)
+++ sandbox/SCons/tools/scons/boost-libs.py 2009-05-04 17:49:07 EDT (Mon, 04 May 2009)
@@ -18,7 +18,7 @@
 
 def BoostUseLib(env, lib):
     env.AppendUnique(
- LIBPATH = env.Dir("#/" + env.Dir(".").path.replace("/" + env["BOOST_LIB"].lower() + "/", "/" + lib + "/")),
+ LIBPATH = ["$BOOST_CURRENT_VARIANT_DIR/" + lib + "/src"],
         LIBS = ["boost_" + lib + env["BOOST_SUFFIX"]]
     )
 
@@ -55,7 +55,10 @@
     env.AddMethod(BoostUseLib)
     env.AddMethod(PythonExtension)
 
- env["INSTALL"] = boost_copy_func
+ env.Replace(
+ INSTALL = boost_copy_func,
+ BOOST_CURRENT_VARIANT_DIR = "$BOOST_BUILD_DIR/libs/$current_variant/$linking/threading-$current_threading"
+ )
 
     AddOption('--stage', dest='stage', action="store_true")
     AddOption('--install', dest='install', action="store_true")

Added: sandbox/SCons/tools/scons/boost-tests.py
==============================================================================
--- (empty file)
+++ sandbox/SCons/tools/scons/boost-tests.py 2009-05-04 17:49:07 EDT (Mon, 04 May 2009)
@@ -0,0 +1,8 @@
+# vi: syntax=python:et:ts=4
+from SCons.Script import AddOption
+
+def exists(env):
+ return True
+
+def generate(env):
+ AddOption('--test', dest='test', action="store_true")


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk