Boost logo

Boost-Build :

Subject: Re: [Boost-build] Handling libraries that are built with external build systems
From: Vladimir Prus (vladimir.prus_at_[hidden])
Date: 2016-06-10 03:29:52


On 08/06/2016 18:22, Christian Aichinger wrote:
> Steven wrote:
>> On 06/08/2016 02:21 AM, Christian Aichinger wrote:
>>> [...] Why is this order not honored?
>>>
>> The issue here is that at the low level, the
>> executable has a dependency on the library,
>> but the object files do not. In addition,
>> for the #include scanner to work, Boost.Build
>> needs to know what header files are created.
>
> Is there any way around this? IOW, is there a solution for the original problem: building libraries with external build tools and using shared/static libraries and headers in my own bjam project?

Chris,

it is possible to use the 'dependency' property to specify this. Here's test code I've used:

    make foo.lib : : @build-extlib ;
    actions build-extlib
    {
        echo "hi" > $(<)
    }
    exe hello : hello.cpp foo.lib : <dependency>foo.lib ;

When I run this with "b2 -n -d+12" I see dependency from hello.obj to foo.lib - this is because the
<dependency> property applies to all file targets in the tree of 'hello'.

This can be simplified further with usage requirements:

     make foo.lib : : @build-extlib ;
     actions build-extlib
     {
         echo "hi" > $(<)
     }
     exe hello : hello.cpp foo.lib : <dependency>foo.lib ;

Some notes:

- The above is only lightly tested
- Boost.Build has no visibility in how external system works, so if foo.lib exists, it will not rerun external
   system.

HTH,
Volodya

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

-- 
Vladimir Prus
http://vladimirprus.com

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