Boost logo

Boost-Build :

Subject: [Boost-build] Alternatives and additional requirements
From: J. van der Wulp (jwulp_at_[hidden])
Date: 2008-10-16 05:38:29


I have a small problem with requirements that should be used for
selecting alternatives and additional requirements. Consider a Jamfile
with the following contents:

lib opengl : : <name>GL <link>shared ;
lib opengl : : <name>opengl32 <target-os>windows ;
alias opengl : : <target-os>darwin : : <framework>OpenGL ;

exe a : a.cpp opengl ;

explicit opengl ;

When invoked (on Linux) Boost Build v2 (version from trunk) presents the
following output.

> bjam toolset=gcc link=static
error: No best alternative for ./opengl
    next alternative: required properties: <link>shared
        not matched
    next alternative: required properties: <target-os>darwin
        not matched
    next alternative: required properties: <target-os>windows
        not matched

I would expect that the second and third alternatives are ruled out on
account of the values of the target-os property. So the first
alternative solely remains and should therefore be selected.

The problem is in the <link>shared requirement of the first alternative
of opengl. It is considered for the selection of an alternative but was
not meant to be; it is a additional requirement on one of the
alternatives. However if the <link>shared requirement is left out the
static build fails with:

cannot find -lGL

Because there is no static version of the GL library. Am I looking at
this in the wrong way? What would be the advised way of doing this?

Thanks in advance,


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at