Boost logo

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
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,

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