Boost logo

Boost-Build :

From: João Luís Pinto (joaoluispinto_at_[hidden])
Date: 2008-09-02 07:11:15

Hi Jurko,

Thank you again for a very, very helpful reply!

Comments inline:

> If I were to guess, I'd say your system_monitor_sources target is an alias
> that you forgot to make explicit and Boost Build is attempting to build it
> 'by default' without some unexpected options. Just guessing here though...

Very good guess :-)

I was not aware of the use of "explicit". Now it works as expected.

> Well, there are several thing you can do or want to do here. You can use
> different alternatives, conditional properties with the source property or
> something else... depending on what you need or want to happen.
> First, you need to decide what you want to happen when you start bjam
> without specifying any target and then you need to decide what you want to
> happen when you explicitly specify the lib target as a dependency for some
> other built target or list it on the command-line.
> I'll assume you want to have the libs simply silently not be built on your
> OS-X if you do not request them explicitly and that you want building them
> to fail if they get requested explicitly. I'll also use the <toolset>
> feature instead of the <host-os> one as that was easier to test for me. In
> that case you could do something like this:


> That should give you different techniques you can combine and use yourself.
> Possibly someone else can suggest some more.

Thank you for the great examples. I'm porting a somewhat big project
(a set of libs and of components based on those libs), and it is my
first big boost-build project, so they were very nice indeed.

I was aiming at the last one of your proposals (silent ignore if
dependency, error - or also silently ignored - if explicitly called).
I tryed your solution and it was OK, except that when I have top level
requirementes, it does not seem to work if explicitly called. I give
you the following test case:


project trash : requirements <threading>multi ;


lib b-lib : [ glob b.cpp ] : <host-os>linux ;
alias b-lib : ;
explicit b-lib ;

exe aaa : a.cpp b-lib ;


#include "b.h"

int main()
    return 0;


#include "b.h"

int test()
    return -1;


#ifndef B_H
#define B_H

int test();


Calling bjam with "bjam b-lib" returns:

error: No best alternative for ./b-lib
    next alternative: required properties: <host-os>linux <threading>multi
        not matched
    next alternative: required properties: <threading>multi
        not matched
...found 1 target...

If the multithreading requirement is removed it works fine.

> Choose whatever suits you best, and if some of them does not really suit
> you perfectly, post a suggestion for a different interface here. If
> possible, try to update Boost Build itself to do what you want it to do and
> post back a patch... the best thing about it is that it is open source. :-)

OK. Its a bit overwhelming for now, but as things move along I'll see
if I can add up something positive!

Many thanks,


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