mirror of
https://github.com/boostorg/build.git
synced 2026-02-10 23:32:20 +00:00
Added support for choosing the toolset and toolset version to be used 'by default' by Boost Build. Allows testing of default toolset functionality.
[SVN r42512]
This commit is contained in:
@@ -63,6 +63,15 @@ import virtual-target ;
|
||||
# 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 @@ rule location ( )
|
||||
}
|
||||
|
||||
|
||||
# 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 @@ local rule should-clean-project ( project )
|
||||
# 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 @@ local rule should-clean-project ( project )
|
||||
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) ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user