|
Boost-Build : |
Subject: Re: [Boost-build] Usage of complex expressions in regular if-statements apart from string literals.
From: Jurko GospodnetiÄ (jurko.gospodnetic_at_[hidden])
Date: 2012-07-19 06:29:18
Hi.
> I am kindly asking you if it is possible to extend without much pain bjam
> functionality in order to support complex expressions (like per-lists
> comparisons or rule invocations) in regular if-statements?
> For example, it is not possible for now to perform neither such comparison:
> if "bla" "bla" = "bla" "bla"
> {
> ECHO Yes! ;
> }
> else
> {
> ECHO No... ;
> }
Actually, all variables are lists so you can do this by using two
additional variables as in:
> local lhs = foo bar ;
> local rhs = foo bar ;
>
> if $(lhs) = $(rhs)
> {
> ECHO Yes! ;
> }
> else
> {
> ECHO No... ;
> }
or you can do something like this to check a rule's return value:
> rule foo
> {
> return figaro bar ;
> }
>
> local expected-result = figaro bar ;
> if [ foo ] = $(expected-result)
> {
> ECHO Yes! ;
> }
> else
> {
> ECHO No... ;
> }
Hope this helps.
Best regards,
Jurko GospodnetiÄ
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