Boost logo

Boost-Build :

From: Khassapov, Alex (Alex.Khassapov_at_[hidden])
Date: 2008-02-20 22:12:21


Yeah, I think it's a bug in my understanding of bjam. Bjam takes time to understand when you need to do something not trivial.

The problem I had was to pass include directories to the cpre compiler, the same way <include> is converted to "-I" for gcc. I just don't know how to achieve this "bjam way", so I did it more "C++ way".

I will have a look at your suggestion, but any further help is appreciated.

-----Original Message-----
From: boost-build-bounces_at_[hidden] [mailto:boost-build-bounces_at_[hidden]] On Behalf Of Jurko Gospodnetic
Sent: Thursday, 21 February 2008 11:43 AM
To: boost-build_at_[hidden]
Subject: Re: [Boost-build] Problem with include directory for generated.cfile

   Hi Alex.

> Hi, I've done it before - in my embedsql rule I convert <include>
> generated by bjam to "-I" option required by cpre compiler:
>
> type.register ESQL : SC ;
> generators.register-standard embedsql.embedsql : ESQL : CPP ;
>
> rule embedsql ( target : source : properties * )
> {
> local r = [ property.select <include> : $(properties) ] ;
> if $(r)
> {
> # Extract <include> directories from $(properties)
> # and replace "<include>" with "-I" to pass to cpre
> local r_ = [ regex.replace-list $(r) : "<include>" : "-I" ] ;
> PREFIX_OPT on $(<) = $(r_) ;
> }
> }
>
> actions embedsql
> {
> cpre $(PREFIX_OPT) -Cansi_c -O$(<) $(>)
> }

   Ick... this seems ugly. I do not use ESQL so I do not understand the
code completely but the idea od manually changing Boost Build's
generated properties seems 'strange'.

   If you really found a need for this then could you please explain it
in more detail? And possibly add a bug report/feature request?

   Could you not have used the Boost Build flag support to propagate
those <include> feature values to your actions - similar to how C++
compiler and linker actions do this? For an example see the
tools/msvc.jam file and how it handles the <include> properties by using
the flags rule to make their values available in the action as the
INCLUDES target variable.

   Many thanks.

   Best regards,
     Jurko Gospodnetiæ

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build


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