Boost logo

Boost-Build :

Subject: Re: [Boost-build] Target OS preprocessor macro
From: Jurko Gospodnetić (jurko.gospodnetic_at_[hidden])
Date: 2012-09-05 10:01:10


   Hi.

   I just tried out your code out now. See comments below.

> import feature ;
> import feature : feature ;

   Stylistic comment: no need really to do 'import feature : feature ;'
here - thats really just an expensive way to shorten the name for the
rule already available as 'feature.feature'.

> if ! $(define-prefix) {
> define-prefix = "" ;
> }

   This whole if construct can be simply be written as:
     'define-prefix ?= "" ;'.

> Jamroot:
>
> import tools/config.jam ;

   This import will not work as written here. You need to remove the
'.jam' suffix here and write it as 'import tool/config' ;'.

> project /root
> : requirements
> <define-prefix>MY_PROJECT_
> <conditional>@tools/config.define-target-os
> ;

   Your Jamroot file does not contain any target definitions so using it
'as is' will not trigger the define-target-os rule.

   On the other hand, after adding a simple target to build in this
Jamroot file, this example shows that free properties are not passed to
indirect conditional rules.

   I do not know if this is intentional or a bug - perhaps someone else
can elaborate on that or you can do some more digging in the Boost Build
repository yourself.

   Code causing this is in the targets.jam module in the
common-properties rule. There all properties except the free ones are
passed on to the common-properties2 rule (which in turn calls
evaluate-requirements, which then calls the specified indirect
conditional rules, all in the same targets.jam module). There is a
comment in the common-properties rule mentioning something about this
being done as some sort of an optimization, so perhaps this is all just
an unfortunate consequence of that (i.e. a fixable bug).

   Hope this helps.

   Best regards,
     Jurko Gospodnetić


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