Boost logo

Boost-Build :

Subject: Re: [Boost-build] Copy previous build target into current unit test directory
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2017-08-01 20:10:28


AMDG

On 08/01/2017 02:01 PM, Chambers, Matthew via Boost-build wrote:
> On 8/1/2017 11:53 AM, Steven Watanabe via Boost-build wrote:
>> If you're using unit-test, then as long as
>> the lib is in the same project and uses the
>> same properties as the unit-test, it will be
>> built in the same directory.
>
> Thanks for the tip about making sure the properties are the same. My
> unit-test had a custom <location-prefix> and was <link>static (inherited
> from default-build) whereas the extension was of course <link>shared and
> didn't have a <location-prefix>. After matching those properties up
> ("<link>shared <library>extension/<location-prefix>foo" on the
> unit-test), it worked. However, this feels quite fragile! And of course
> as you mentioned it depends on them being in the same project.
>

To copy files, you can use:
install copied-library : /other-project//library-target ;

(Normally install is used with a <location>, but if
you leave off the location, it will copy the files
to the regular build directory.)

> Can Boost.Build have a built-in propagated free feature that acts like
> <dependency> but copies the depended-on target (or simple file) to the
> build directory? This would be very helpful on Windows for interacting
> with .NET, and would be useful for using/testing dynamic plugins as
> above. I actually hacked my own msvc.jam a long time ago to support an
> <assembly> feature which not only copies the file to the output
> directory, but also adds it to the compile command (/FU). Along with a
> few other customizations, this allows my BB to build C++/CLI. But my
> implementation was hacky so I haven't contributed it. I didn't know how
> to do it properly in BB and it seems that dynamic plugins need this to
> work for multiple toolsets.
>

In Christ,
Steven Watanabe


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