Boost logo

Boost-Commit :

From: jurko.gospodnetic_at_[hidden]
Date: 2008-01-06 02:17:09


Author: jurko
Date: 2008-01-06 02:17:08 EST (Sun, 06 Jan 2008)
New Revision: 42512
URL: http://svn.boost.org/trac/boost/changeset/42512

Log:
Added support for choosing the toolset and toolset version to be used 'by default' by Boost Build. Allows testing of default toolset functionality.
Text files modified:
   trunk/tools/build/v2/build-system.jam | 39 +++++++++++++++++++++++++++++++++++----
   1 files changed, 35 insertions(+), 4 deletions(-)

Modified: trunk/tools/build/v2/build-system.jam
==============================================================================
--- trunk/tools/build/v2/build-system.jam (original)
+++ trunk/tools/build/v2/build-system.jam 2008-01-06 02:17:08 EST (Sun, 06 Jan 2008)
@@ -63,6 +63,15 @@
 # Was an XML dump requested?
 .out-xml = [ MATCH ^--out-xml=(.*)$ : $(.argv) ] ;
 
+# Default toolset & version to be used in case no other toolset has been used
+# explicitly by either the loaded configuration files, the loaded project build
+# scripts or an explicit toolset request on the command line. If not specified,
+# an arbitrary default will be used based on the current host OS. This value,
+# while not strictly necessary, has been added to allow testing Boost-Build's
+# default toolset usage functionality.
+.default-toolset = ;
+.default-toolset-version = ;
+
 
 ################################################################################
 #
@@ -91,6 +100,18 @@
 }
 
 
+# Sets the default toolset & version to be used in case no other toolset has
+# been used explicitly by either the loaded configuration files, the loaded
+# project build scripts or an explicit toolset request on the command line. For
+# more detailed information see the comment related to used global variables.
+#
+rule set-default-toolset ( toolset : version ? )
+{
+ .default-toolset = $(toolset) ;
+ .default-toolset-version = $(version) ;
+}
+
+
 ################################################################################
 #
 # Local rules.
@@ -477,10 +498,20 @@
     # the default toolset.
     if ! $(.legacy-ignore-config) && ! [ feature.values <toolset> ]
     {
- local default-toolset = gcc ;
- if [ os.name ] = NT
+ local default-toolset = [ modules.peek toolset : .default-toolset ] ;
+ local default-toolset-version = ;
+ if $(default-toolset)
         {
- default-toolset = msvc ;
+ default-toolset-version =
+ [ modules.peek toolset : .default-toolset-version ] ;
+ }
+ else
+ {
+ default-toolset = gcc ;
+ if [ os.name ] = NT
+ {
+ default-toolset = msvc ;
+ }
         }
 
         ECHO "warning: No toolsets are configured." ;
@@ -490,7 +521,7 @@
         ECHO "warning: For more configuration options, please consult" ;
         ECHO "warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html" ;
 
- toolset.using $(default-toolset) ;
+ toolset.using $(default-toolset) : $(default-toolset-version) ;
     }
 
 


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