Boost logo

Boost-Build :

Subject: Re: [Boost-build] how to add a dependency to a dependency
From: Stjepan Rajko (stjepan.rajko_at_[hidden])
Date: 2009-01-25 18:54:51


On Sat, Jan 24, 2009 at 11:24 AM, Steven Watanabe <watanabesj_at_[hidden]> wrote:
>
> Instead of using a free feature, you can use a composite feature:
>
> feature use_window_manager_impl : : dependency free ;
> feature use_window_manager : : composite propagated ;
>
> rule define-window-manager ( name : target )
> {
> feature.extend use_window_manager : $(name) ;
> feature.compose <use_window_manager>$(name) :
> <use_window_manager_impl>$(target) ;
> }
>
> This will also have the effect that you'll get separate build directories
> for
> each window manager.
>

Thanks again Steven, this is a good idea. I got something to work
based on your suggestion in a simplified case, but am still having
problems with my general situation. I have this in one Jamfile:

feature.feature use_window_manager : : composite propagated ;

In a Jamfile that describes how to link to the system glut / openGL, I
have this:

*** Alternative 1 (works on darwin) ***

feature.extend use_window_manager : platform_glut ;
feature.compose <use_window_manager>platform_glut
        : <linkflags>"-framework GLUT -framework OpenGL" ;

*** End Alternative 1 ***

The above works on darwin (I can have a target
<use_window_manager>platform_glut in requirements), but I need
different settings for different toolsets. So, I tried:

*** Alternative 2 (doesn't work) ***

# lib glut, glut32, opengl32, glu32...

feature.extend use_window_manager : platform_glut ;
feature.compose <use_window_manager>platform_glut :
            <toolset>gcc:<library>glut
        <toolset>darwin:<linkflags>"-framework GLUT -framework OpenGL"
        <toolset>msvc:<library>glut32
        <toolset>msvc:<library>opengl32
        <toolset>msvc:<library>glu32
    ;

*** End Alternative 2 ***

This one doesn't work - feature.compose complains about the
conditional features.

So, I also tried:

*** Alternative 3 (doesn't work) ***

# lib glut, glut32, opengl32, glu32...

alias platform_glut : : : :
        <toolset>gcc:<library>glut
        <toolset>darwin:<linkflags>"-framework GLUT -framework OpenGL"
        <toolset>msvc:<library>glut32
        <toolset>msvc:<library>opengl32
        <toolset>msvc:<library>glu32
        ;

feature.extend use_window_manager : platform_glut ;
feature.compose <use_window_manager>platform_glut
        : <library>/boost/guigl/platform//platform_glut ;

# /boost/guigl/platform//platform_glut is the alias platform_glut

*** End alternative 3 ***

The above fails when a target has <use_window_manager>platform_glut in
requirements, claiming recursion in main target references
(platform_glut is built twice). I am assuming that since
platform_glut becomes a dependency of of the target, it is added as a
dependency to itself.

I tried a few more things, but no luck :-(

Best,

Stjepan


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