Boost logo

Boost-Build :

Subject: Re: [Boost-build] Problem with notfile target
From: Ian Emmons (iemmons_at_[hidden])
Date: 2008-11-29 12:53:23


On Nov 29, 2008, at 3:02 AM, Vladimir Prus wrote:

> On Saturday 29 November 2008 06:59:47 Ian Emmons wrote:
>
> Hi Ian,
>
>> lib Parliament
>> : [ glob *.cpp : Utf8StaticInitGen.cpp ]
>> /site-config//BerkeleyDB
>> /site-config//JavaJNI
>> JniHeaders
>> : <include>.
>> <define>BUILDING_KBCORE
>> <define>PARLIAMENT_RSRC_AS_UTF16
>> <define>_REENTRANT
>> <threading>multi
>> : # default build
>> : <include>. ;
>>
>> notfile JniHeaders : @BuildJniHeaders ;
>> actions BuildJniHeaders
>> {
>> ant jniHeaders
>> }
>>
>> If I comment out the source dependency of the library target on the
>> JniHeaders target, then this works perfectly, except that the two
>> targets run in the wrong order. But with the source dependency as
>> above, I get the following error:
>>
>> /Users/iemmons/bin/boost-build/build/generators.jam:951: in ensure-
>> type from module generators
>> error: target { Jamfile</Users/iemmons/dev/KB/Parliament/KbCore>
>> %Jamfile</Users/iemmons/dev/KB/Parliament/KbCore>.BuildJniHeaders-
>> JniHeaders. } has no type
>
> ...
>> This is puzzling to me, because it seems that the definition of
>> JniHeaders as a "notfile" target should tell boost build that
>> JniHeaders has no type. Any ideas about what I'm doing wrong?
>
> Yes, JniHeaders indeed has no type -- which is fine. But then, you're
> adding it as sources of the 'lib' target, and the 'lib' target has no
> idea what to do with targets of unknown type.
>
> Probably, instead of adding the target to sources, you can use
>
> <dependency>JniHeaders
>
> in requirements?
>
> - Volodya

Thanks for the quick reply.

Your suggestion does indeed cause the JniHeaders target to run before
the library is built, but it has two undesirable side effects:

* It causes the library is completely rebuilt every time, as if I did
a bjam --clean beforehand.

* It causes the JniHeaders target to run after the library is built as
well (i.e., it runs twice).

It would be nice if the lib rule could just ignore source dependency
targets of unknown type.

Thanks,

Ian


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