$include_dir="/home/hyper-archives/boost-build/include"; include("$include_dir/msg-header.inc") ?>
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