|
Boost-Build : |
From: Mark Evans (evans_mark_at_[hidden])
Date: 2007-05-02 14:34:31
Hi guys,
I would like for a Jamfile to conditionally run a unit test only if the
toolset is gcc. My naive attempt was the following.
-----
rule conditional-unittest ( targets * : sources * : properties * )
{
if <toolset>gcc in $(properties)
{
run testing/foo.c libFOO ;
}
}
make unittest : : conditional-unittest ;
-----
but this fails with:
/cygdrive/c/cygwin/usr/local/tools/boost-build/build/targets.jam:307: in
object(project-target)@66.add-alternative from module
object(project-target)@66
error: add-alternative called when main targets are already created.
Is there a way to test the toolset property in a Jamfile with something like
if [ get-toolkit ] = gcc
{
run ...
}
Many thanks,
Mark
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