Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-01-24 03:33:57


Hi Matthew,

> I'm trying to detect in a rule definition whether or not the current target
> is being built as variant=debug or variant=release. I know about
> conditional properties, but they won't assist here, as I don't simply want
> to supply different parameters to the compiler, I want to branch the whole
> behaviour.

Can you describe what you're trying to do in more detail? In general, by the
time a target is defined in Jamfile, you can't get current build properties,
because there are none. Each target defined in Jamfile can be build with 10
different properties set, and when you just define a target, it's not clear
which one of those 10 property sets you want.

> I've tried simply reading _any_ feature specified at the command line into
> a variable, and can't seem to do so:
>
> Running the attached test.jam module from the command-line with
>
> bjam thing=hello

How did you run "test.jam"? The above comamnd line won't work unless you have
"Jamroot" file in the current directory (or "project-root.jam", for older V2).

> I'd expect to see hello assigned to thing, but isn't happening. This must
> be something simple.

That assignment will only happen when actual build commands are generated, and
only for file targets that are build with "test.test" action. Maybe you can
provide the complete test case you have?

- 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