Boost logo

Boost-Build :

From: Khassapov, Alex (Alex.Khassapov_at_[hidden])
Date: 2008-02-20 19:11:16

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 = [ <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$(<) $(>)

-----Original Message-----
From: boost-build-bounces_at_[hidden]
[mailto:boost-build-bounces_at_[hidden]] On Behalf Of Vladimir Prus
Sent: Thursday, 21 February 2008 4:18 AM
To: boost-build_at_[hidden]
Subject: Re: [Boost-build] Problem with include directory for generated

Eli Green wrote:

> I've created a generator that lets me turn .ec (Informix ESQL) into .c
> files. This part works perfectly. The next part, actually compiling
the .c
> file, is failing because the current directory is not being searched
> header files. So where bjam is doing this:
> esql -e xxx.c
> gcc -c xxx.c
> I want to somehow convince it to do this:
> esql -e xxx.c
> gcc -I. -c xxx.c
> While I'm relatively familiar with normal Perforce Jam, bjam's build
> is obviously a fair bit more complex and I get the feeling I can't
> append "." to INCLUDE on $(<). If that IS possible, I just need to
> where to do it.

How is compiling of a generated file .c different from compilation of
an ordinary .c file? If the header file is not generated,
then the 'include' feature allows to add an include path.

If the header file itself is generated, see

- Volodya

Unsubscribe & other changes:

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