Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-08-03 17:10:43


On 8/2/06, Rene Rivera <grafik_at_[hidden]> wrote:
>
> Update of /cvsroot/boost/boost/tools/build/v2/tools
> In directory
> sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18447/tools/build/v2/tools
>
> Modified Files:
> gcc.jam
> Log Message:
> Skip targets that can't be generated like BBv1 does.
>
> Index: gcc.jam
> ===================================================================
> RCS file: /cvsroot/boost/boost/tools/build/v2/tools/gcc.jam,v
> retrieving revision 1.77
> retrieving revision 1.78
> diff -u -d -r1.77 -r1.78
> --- gcc.jam 16 Jun 2006 21:52:54 -0000 1.77
> +++ gcc.jam 2 Aug 2006 18:26:30 -0000 1.78
> @@ -1,10 +1,10 @@
> -# Copyright (c) 2001 David Abrahams.
> -# Copyright (c) 2002-2003 Rene Rivera.
> -# Copyright (c) 2002-2003 Vladimir Prus.
> +# Copyright 2001 David Abrahams.
> +# Copyright 2002-2006 Rene Rivera.
> +# Copyright 2002-2003 Vladimir Prus.
> #
> -# Use, modification and distribution is subject to the Boost Software
> -# License Version 1.0. (See accompanying file LICENSE_1_0.txt or
> -# http://www.boost.org/LICENSE_1_0.txt )
> +# Distributed under the Boost Software License, Version 1.0.
> +# (See accompanying file LICENSE_1_0.txt or copy at
> +# http://www.boost.org/LICENSE_1_0.txt )
>
> import toolset : flags ;
> import property ;
> @@ -254,36 +254,54 @@
> # since it's not supported by gcc/libc.
> class gcc-linking-generator : unix-linking-generator
> {
> - rule generated-targets ( sources + : property-set : project name ? )
> + rule can-build ( target-type : property-set : sources * )
> {
> - if <runtime-link>static in [ $(property-set).raw ]
> + local no-static-link = ;
> + if [ modules.peek : UNIX ]
> {
> - local m ;
> - if [ id ] = "gcc.link.dll"
> + switch [ modules.peek : JAMUNAME ]
> + {
> + case * : no-static-link = true ;
> + }
> + }
> +
> + local properties = [ $(property-set).raw ] ;
> + local reason ;
> + if $(no-static-link) && <runtime-link>static in $(properties)
> + {
> + if <link>shared in $(properties)
> + {
> + reason =
> + "On gcc, DLL can't be build with
> '<runtime-link>static'." ;
> + }
> + else if [ type.is-derived $(target-type) EXE ]
> {
> - m = "on gcc, DLL can't be build with
> <runtime-link>static" ;
> - }
> - if ! $(m) {
> for local s in $(sources)
> {
> local type = [ $(s).type ] ;
> - if $(type) && [ type.is-derived $(type) SHARED_LIB ]
> + if $(type) && [ type.is-derived $(type) SHARED_LIB ]
>
> {
> - m = "on gcc, using DLLS together with the
> <runtime-link>static options is not possible " ;
> - }
> - }
> - }
> - if $(m)
> - {
> - errors.user-error $(m) :
> - "it's suggested to use <runtime-link>static together
> with the <link>static" ;
> + reason =
> + "On gcc, using DLLS together with the"
> + "<runtime-link>static options is not possible
> " ;
> + }
> + }
> }
> -
> }
> -
> - return [ unix-linking-generator.generated-targets
> - $(sources) : $(property-set) : $(project) $(name) ] ;
> - }
> + if $(reason)
> + {
> + ECHO warn:
> + $(reason) ;
> + ECHO warn:
> + "It's suggested to use '<runtime-link>static' together"
> + "with the '<link>static'." ;
> + return ;
> + }
> + else
> + {
> + return true ;
> + }
> + }
> }

I'm not sure about one thing. This code is called from
find-viable-generators, and emits some warnings. Finding viable generators
is the first step in generator selection, we can find 3 generators and then
select one. The fact that find-viable-generator has found a generator does
not mean it will run. So, you can emit a warning for a generator that is not
run.

Am I missing something?

- Volodya



Boost-Build 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