|
Boost-Build : |
Subject: Re: [Boost-build] explicit rule does not take conditional requirements
From: Juraj Ivanèiæ (juraj.ivancic_at_[hidden])
Date: 2011-05-10 10:12:09
On 10.5.2011 14:24, John Reid wrote:
> Some of my tests run slowly in a debug build. I would like to be able to
> do something like:
>
> explicit python_test_find_starts :<variant>:debug ;
>
> so that they only run in release builds by default. Presumably I can do
> something like:
>
> if<some condition to test build type here> {
> explicit python_test_find_starts ;
> }
>
> What can I use for the condition?
You can add <variant>debug:<build>no to targets requirements, but what
you really want is to build only in release mode, so I would recommend this:
rule release-only ( rule target : 2 * : 3 * : 4 * : 5 * : 6 * : 7 * )
{
$(rule) $(target) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) ;
explicit $(target) ;
alias make-release-$(target) ;
alias make-release-$(target) : $(target) : <variant>release ;
}
release-only exe test : test.cpp ;
Here I introduced a helper rule to reduce syntax noise, but you get the
idea.
HTH
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